scripts: remove . from $PATH
Add CT_SanitizePath function which removes entries referring to ., /tmp
and non-existing directories from $PATH, and call it early in the
build script.
If . is in PATH, gcc-4.4.4 build breaks:
[ALL ] checking what assembler to use...
/tmp/build/targets/arm-unknown-linux-uclibcgnueabi/build/gcc-core-static/arm-unknown-linux-uclibcgnueabi/bin/as
...
[ALL ] config.status: creating as
i.e. "as" is supposed to be the arm-unknown-linux-uclibcgnueabi cross assembler,
but config.status creates a local "as" script which is calling the
host assembler.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
[Yann E. MORIN: style fixes + explanations]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 20dd8cef1c8adff0aa3e78ae6d7acfbc45ed5a83)
1 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
2 2004-09-20 Jakub Jelinek <jakub@redhat.com>
4 * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
7 * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
9 * config/ia64/crtbegin.asm: Likewise.
10 * config/ia64/crtend.asm: Likewise.
11 * config/ia64/crti.asm: Likewise.
12 * config/ia64/crtn.asm: Likewise.
14 2004-05-14 Jakub Jelinek <jakub@redhat.com>
16 * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
18 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm
19 --- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200
20 +++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm 2008-06-10 14:58:17.000000000 +0200
24 .weak _Jv_RegisterClasses
27 +.section .note.GNU-stack; .previous
29 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm
30 --- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200
31 +++ gcc-4.3.1/gcc/config/ia64/crtend.asm 2008-06-10 14:58:17.000000000 +0200
35 .endp __do_global_ctors_aux
38 +.section .note.GNU-stack; .previous
40 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm
41 --- gcc-4.3.1.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200
42 +++ gcc-4.3.1/gcc/config/ia64/crti.asm 2008-06-10 14:58:17.000000000 +0200
49 +.section .note.GNU-stack; .previous
51 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm
52 --- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200
53 +++ gcc-4.3.1/gcc/config/ia64/crtn.asm 2008-06-10 14:58:17.000000000 +0200
60 +.section .note.GNU-stack; .previous
62 diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm
63 --- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200
64 +++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm 2008-06-10 14:58:17.000000000 +0200
71 +.section .note.GNU-stack; .previous
73 diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h
74 --- gcc-4.3.1.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100
75 +++ gcc-4.3.1/gcc/config/ia64/linux.h 2008-06-10 14:58:17.000000000 +0200
78 #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
80 +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
82 /* This is for -profile to use -lc_p instead of -lc. */
84 #define CC1_SPEC "%{profile:-p} %{G*}"
85 diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h
86 --- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200
87 +++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h 2008-06-10 14:58:17.000000000 +0200
89 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
92 -#if defined __linux__ && !defined __powerpc64__
93 +#if defined __linux__
94 .section .note.GNU-stack