Morton, John a écrit :
As expected "glibc.i686" was preinstalled. I tried installing the i386 and x86_64 Red Hat rpms for "glibc-devel". Both rpms reported some unsatisfied dependencies. To make a long story short, in both cases the geometric growth of the dependency tree looks like it will eventually force all of the gcc C compiler to be installed. Maybe it's my non-C background but this hidden 3 file dependency (upon C) seems unreasonable given that all that gpc needs (see output below) is for those object files to be visible to the ld linker (assuming these object files are not dependent upon other files).
Here is what I'd like to do:
- Place copies of the 3 object files (crt1.o, crtl.o, ctrn.o) into their
own folder or my application folder (or in "/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.6" since that folder already contains other "crt" files such as "crtbegin.o") then set up the linker search path appropriately.
- Separate the gpc compile and link steps (using makefiles for each
phase).
- Compile each of the 70+ source files that make up our application
separately then pass a makefile (i.e. a list of the corresponding object files) to the linker.
- The object files need to be persistent across compiles (not deleted
after the link stage).
- Be able to pass/specify additional libraries and object files to the
linker
I expect this should be relatively straightforward except for extracting the 3 object files. What is the easiest way of getting these files?
Also what Linux based SDKs, meeting the above requirements, are being used with gpc? We already use a Linux version of the Rational/IBM Clearcase and Clearquest config management tools. Hopefully there are some Linux based SDKs that are compatible with these CM tools.
Thanks
The results of my latest compile attempt:
[etms@lxstn08 dev]$ gpc -v -Wa,--32 hello.pas
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.6/specs Configured with: ../gcc-3.4.6/configure --enable-languages=pascal Thread model: posix gpc version 20070904, based on gcc-3.4.6 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.6/gpc1 -quiet -v hello.pas
-quiet -dumpbase hello.pas -mtune=pentiumpro -auxbase hello -famtmpfile=/tmp/ccobDgZ4.gpa -version -o /tmp/cci6p6IZ.s GNU Pascal version 20070904, based on gcc-3.4.6 (i686-pc-linux-gnu) compiled by GNU C version 3.4.6. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Pascal Compiler PreProcessor version 20070904, based on gcc-3.4.6 as -V -Qy --32 -o /tmp/ccWia0MX.o /tmp/cci6p6IZ.s GNU assembler version 2.17.50.0.6-12.el5 (x86_64-redhat-linux) using BFD version 2.17.50.0.6-12.el5 20061020
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.6/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 crt1.o crti.o /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.6/crtbegin.o -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.6 -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.6/../../.. /tmp/ccWia0MX.o -lgpc -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.6/crtend.o crtn.o
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status [etms@lxstn08 dev]$
I looked to the -v messages while compiling some gpc program of mine. It needs also crt1.o crti.o crtn.o and these files are contained in /usr/lib and /usr/lib64 for the 32 or 64 bits version. gpc itself is in /usr/local and the system gcc is in /usr I do no know how to determine how my files came here. But do not try dirty tricks, I have'nt Just resolve dependencies by installing required packages.
for refernce the message in my case was
/usr/local/libexec/gcc/x86_64-redhat-linux/3.4.4/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /home/Lombardi/gpc/test9 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /usr/local/lib/gcc/x86_64-redhat-linux/3.4.4/crtbegin.o -L/usr/local/lib/gcc/x86_64-redhat-linux/3.4.4 -L/usr/local/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../lib64 -L/usr/local/lib/gcc/x86_64-redhat-linux/3.4.4/../../.. -L/lib/../lib64 -L/usr/lib/../lib64 /home/Lombardi/o/test9.o -lgpc -lm -lgcc -lc -lgcc /usr/local/lib/gcc/x86_64-redhat-linux/3.4.4/crtend.o /usr/lib/../lib64/crtn.o
Maurice