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]

gcc 4.8.3 configure/build targeting alpha dec does not fully respect --prefix - or is it something else?

The github-repo contains the scripts, files AND complete build-logs (so no need to run the script yourself) separated for each step that i will use here as a "walkable" reference. Its better read/clickable then this long email.
I'll try to keep the github up to date if somethings changes.


I want to add alpha dec support to the current stable Cross Linux From Scratch (CLFS 3.0 (which uses gcc 4.8.3 as source base)
CLFS 3.0 currently only supports x86/mips/sparc/arm/powerpc.
Using a ready-for-use-cross-development-toolkit is not an option for being CLFS conform.

Work so far - the build-script

Iâve written a bash script (for being consistent in building for the different targets)
that is doing the CLFS "5. Constructing Cross-Compile Tools" chapter.

Its based on and

I've got extra follow up scripts for building kernel, bash, hello world etc. but I haven't included them here to keep the problem report smaller.

The script needs sudo to add /tools and /cross-tools symbolic links to the root - the CLFS gcc patches are directing to them - but thats all

The script checks for every possible error and exits with current step/substep info on any fail, it logs every ./configure, make, make install run
and creates some extra info files for searchdirs, paths etc.

Every package is built out of Source-Tree and freshly extracted/removed in every step.

The target configuration (build script line 35-70) is the only part of the script which is target specific. The rest of the script only uses these variables, no target related ifs/switch-cases while configuring/building are present.

This is the essence of the script:

step(04) starting at line 299 in the build script
* step( 4): 5.2.  File-5.19
* step( 5): 5.3.  Linux-3.14.21 Headers
* step( 6): 5.4.  M4-1.4.17
* step( 7): 5.5.  Ncurses-5.9
* step( 8): 5.6.  Pkg-config-lite-0.28-1
* step( 9): 5.7.  GMP-6.0.0
* step(10): 5.8.  MPFR-3.1.2
* step(11): 5.9.  MPC-1.0.2
* step(12): 5.10. ISL-0.12.2
* step(13): 5.11. CLooG-0.18.2
* step(14): 5.12. Cross Binutils-2.24
* step(15): 5.13. Cross GCC-4.8.3
* step(16): 5.14. Glibc-2.19
* step(17): 5.15. Cross GCC-4.8.3 <-- alpha fails here


what is working:

Sparc64-64 and mips64-64 are working perfectly - Iâm able to compile and run a linux kernel + bash + hello-world in sparc64/mips64-qemu
based on the built cross-tools.

the problem:

If building for alpha target the script fails in step(17) with linking crti.o in line 3776

My findings so far:

The reason for the fail in step(17) is that the built gcc in step(15) got the wrong gcc search-dirs, whereas sparc64-64/mips64-64 got the correct and equal gcc-search-dirs, but the alpha target differs in the last 4 paths.

Logged gcc search-dirs:

gcc_search_dirs.(diffable).out is generated in step(15) Cross GCC-4.8.3,, line: 723/726

better readable search-dirs

for being better diffable target replaced by {TARGET}, clfs_target replace by [CLFS_TARGET} etc.

logged c-runtime location:

-the crti.o is the same in all target-folders - that seems correct

crt-path.out is generated in step(16) Glibc-2.19,, line: 776

logged ld SEARCHDIR:

the ld searchpath is the same "/tools/lib" for all targets - that seems correct

ld_SEARCHDIR.out is generated in step(14) Cross Binutils-2.24,, line: 626

the configure/make differences between the targets:

the mips64/sparc64/alpha Makefile/config.(status|log) for step(15) Cross GCC-4.8.3 are nearly equal for the targets
and it doesn't seem that the gcc-search-dirs difference comes from here

see folder for being better diffable the target replaced by {TARGET}, the clfs_target replace by [CLFS_TARGET} etc. so its easier to diff localy with the prefered tool

My suspicions so far :

First idea: The also alpha targeting (but not supported) CLFS gcc patching does not "change" enough for alpha

in step(15) Cross GCC-4.8.3,

1. line 680: patch -Np1 -i "${FILES}/gcc-4.8.3-pure64_specs-1.patch"
2. line 683: echo -en '/n#undef STANDARD_STARTFILE_PREFIX_1/n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"/n' >> gcc/config/linux.h 3. line 685: echo -en '/n#undef STANDARD_STARTFILE_PREFIX_2/n#define STANDARD_STARTFILE_PREFIX_2 ""/n' >> gcc/config/linux.h

The patching only changes files in /gcc/config

I've copyied the original and patched /gcc/config tree into the folder - so its easier to diff localy with the prefered tool

Second and better idea:

i think gcc ./configure does not treat the parameters --prefix=/cross-tools and --with-local-prefix=/tools in step(15) Cross GCC-4.8.3, the same way for alpha as for mips/sparc targets because the CLFS gcc patch does not patch /cross-tools into the sources at all so /cross-tools from the gcc-search-dirs must come through gcc configure parameters - but are just partialy missing with target alpha

so mips/sparc respecting --prefix=/cross-tools, but alpha only partialy - seems to be a bug in gcc/configuration


Any idea/hint where/how to find/correct the gcc-search-dirs differences for the alpha target to be CLFS conform and buildable?



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