This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA:] fix bug in configure header-probing for stack protector support in target C library

This patch fixes target-header-probing for cross-builds that
aren't using sysroot (just --target and --prefix), as in the
difference for crisv32-axis-linux-gnu with an eglibc-2.15-based

--- cllog.prev	Thu May 31 22:00:10 2012
+++ cllog	Thu May 31 22:00:09 2012
@@ -1276,7 +1276,7 @@ checking linker --as-needed support... y
 checking linker --build-id support... yes
 checking linker *_sol2 emulation support... no
 checking linker --sysroot support... yes
-checking __stack_chk_fail in target C library... no
+checking __stack_chk_fail in target C library... yes
 checking sys/sdt.h in the target C library... no
 checking dl_iterate_phdr in target C library... unknown
 Using ggc-page for garbage collection.

Without this patch, the non-existing directory
target_header_dir=NONE/crisv32-axis-linux-gnu/sys-include is
probed due to exec_prefix=NONE, duh.  There's code setting a
separate variable test_exec_prefix that is then used to handle
this kind of testing for sysroot configures, but it is inside
code only executed if --with-sysroot is used.  There's no reason
for it being there as it's not depending on the processing done
there or on sysroot settings.  So let's move it to before the
with-sysroot stuff and use it when setting target_header_dir.
Tested configuring for crisv32-axis-linux-gnu and building past
this part (build completes successfully with the expected
observable change as per the use in gcc.c); no difference for

Ok to commit?

	Fix configure test for "stack protector support in target C library".
	* (test_prefix, test_exec_prefix): Move setting from
	inside sysroot handling to before and outside it.
	* configure: Regenerate.

--- gcc.prev/gcc/	2012-05-25 14:28:50.000000000 +0200
+++ gcc/gcc/	2012-05-31 21:20:07.000000000 +0200
@@ -747,6 +747,17 @@ AC_ARG_WITH(build-sysroot, 
+if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ test_prefix=$prefix
+if test "x$exec_prefix" = xNONE; then
+ test_exec_prefix=$test_prefix
+ test_exec_prefix=$exec_prefix
 		[search for usr/lib, usr/include, et al, within DIR])],
@@ -759,16 +770,6 @@ AC_ARG_WITH(sysroot,
- if test "x$prefix" = xNONE; then
-  test_prefix=/usr/local
- else
-  test_prefix=$prefix
- fi
- if test "x$exec_prefix" = xNONE; then
-  test_exec_prefix=$test_prefix
- else
-  test_exec_prefix=$exec_prefix
- fi
@@ -4528,11 +4529,11 @@ if test x$host != x$target || test "x$TA
   if test "x$with_headers" != x; then
   elif test "x$with_sysroot" = x; then
-    target_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+    target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
   elif test "x$with_build_sysroot" != "x"; then
   elif test "x$with_sysroot" = xyes; then
-    target_header_dir="${exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"
+    target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"

brgds, H-P

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]