This is the mail archive of the gcc-help@gcc.gnu.org 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]

Re: Compiling problem with gcc4.5 libgcc


Hi,

First thanks to Ian for the link below. I'm following up in this way in case it is of any use to anyone else.

On 05/05/2010 06:57 PM, Ian Lance Taylor wrote:
mike<mikereape@onetel.com> writes:

checking for
i686-pc-linux-gnu-gcc... /home/mike/gcc-obj-dir/./gcc/xgcc
-B/home/mike/gcc-obj-dir/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/
-B/usr/local/i686-pc-linux-gnu/lib/ -isystem
/usr/local/i686-pc-linux-gnu/include -isystem
/usr/local/i686-pc-linux-gnu/sys-include
checking for suffix of object files... configure: error: in
/home/mike/gcc-obj-dir/i686-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/mike/gcc-obj-dir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/mike/gcc-obj-dir'
make: *** [all] Error 2
http://gcc.gnu.org/wiki/FAQ#Configuration_fails_with_.27.27configure:_error:_cannot_compute_suffix_of_object_files:_cannot_compile.27.27._What_is_the_problem.3F

Ian

After consulting the link I did "make distclean" on the gmp, mpc and mfrc installs that I pre-installed before trying to build gcc. I moved the relevant directories under the top-level gcc source directory. On the basis of the link I checked out config.log and found that I was missing libelf (the source directory not libelf.h) so I installed libelf-0.8.9. Crucially the libelf directory ended up in /usr/local/include and not /usr/local. All it contains is the following:

  -rw-r--r--. 1 root root 24540 2010-05-06 21:06 elf_repl.h
  -rw-r--r--. 1 root root  5046 2010-05-06 21:06 gelf.h
  -rw-r--r--. 1 root root  8133 2010-05-06 21:06 libelf.h
  -rw-r--r--. 1 root root  1447 2010-05-06 21:06 nlist.h
  -rw-r--r--. 1 root root  3888 2010-05-06 21:06 sys_elf.h

I then did configure and make again and it finished with:


lto/lto-elf.o: In function `lto_elf_file_open':
lto-elf.c:(.text+0xcb5): undefined reference to `elf_getshdrstrndx'
collect2: ld returned 1 exit status
make[3]: *** [lto1] Error 1
make[3]: Leaving directory `/home/mike/LLJVM/gcc/gcc-4.5.0/gcc-4.5.0/host-i686-pc-linux-gnu/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/home/mike/LLJVM/gcc/gcc-4.5.0/gcc-4.5.0'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/mike/LLJVM/gcc/gcc-4.5.0/gcc-4.5.0'
make: *** [all] Error 2
so I guess it blew up in the linker. Stupidly I didn't check config.log after I did the configure. Of course the object directory (gcc-obj-dir in my case) was empty so I couldn't look at the config.log file to find out what was wrong.

A little googling led me to the following thread: http://gcc.gnu.org/ml/gcc/2010-03/msg00126.html, http://gcc.gnu.org/ml/gcc/2010-03/msg00127.html and http://gcc.gnu.org/ml/gcc/2010-03/msg00128.html which discusses using elfutils-libelf 0.145 the relevance being the difference between elf_getshstrndx and elf_getshdrstrndx the difference being that there is an extra "d" in the latter. So then I installed elfutils-libelf-0.145-1.fc11.i586.rpm and this is what I got:

[root@desktop gcc-obj-dir]# rpm -ivv ~mike/LLJVM/elfutils-libelf-0.145-1.fc11.i586.rpm
D: ============== /home/mike/LLJVM/elfutils-libelf-0.145-1.fc11.i586.rpm
D: Expected size: 66562 = lead(96)+sigs(1284)+pad(4)+data(65178)
D: Actual size: 66562
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name rdonly mode=0x0
D: read h# 1431 Header sanity check: OK
D: added key gpg-pubkey-d22e77f2-49750871 to keyring
D: read h# 1798 Header sanity check: OK
D: added key gpg-pubkey-7fac5991-4615767f to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: /home/mike/LLJVM/elfutils-libelf-0.145-1.fc11.i586.rpm: Header V3 RSA/SHA256 signature: OK, key ID d22e77f2
D: ========== relocations
D: added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ elfutils-libelf-0.145-1.fc11 i586/linux 0x1
D: opening db index /var/lib/rpm/Depends create mode=0x0
D: opening db index /var/lib/rpm/Basenames rdonly mode=0x0
D: read h# 708 Header V3 RSA/SHA256 signature: OK, key ID d22e77f2
D: Requires: /sbin/ldconfig YES (db files)
D: Requires: /sbin/ldconfig YES (cached)
D: opening db index /var/lib/rpm/Providename rdonly mode=0x0
D: Requires: ld-linux.so.2 YES (db provides)
D: Requires: ld-linux.so.2(GLIBC_2.3) YES (db provides)
D: Requires: libc.so.6 YES (db provides)
D: Requires: libc.so.6(GLIBC_2.0) YES (db provides)
D: Requires: libc.so.6(GLIBC_2.1) YES (db provides)
D: Requires: libc.so.6(GLIBC_2.1.3) YES (db provides)
D: Requires: libc.so.6(GLIBC_2.2) YES (db provides)
D: Requires: libc.so.6(GLIBC_2.3) YES (db provides)
D: Requires: libc.so.6(GLIBC_2.4) YES (db provides)
D: Requires: libelf.so.1 YES (added provide)
D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides)
D: Requires: rpmlib(FileDigests) <= 4.6.0-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides)
D: Requires: rpmlib(VersionedDependencies) <= 3.0.3-1 YES (rpmlib provides)
D: Requires: rtld(GNU_HASH) YES (db provides)
D: opening db index /var/lib/rpm/Conflictname rdonly mode=0x0
D: closed db index /var/lib/rpm/Depends
D: ========== recording tsort relations
D: Requires: libelf.so.1 YES (added provide)
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)
D: 0 0 0 0 1 0 +elfutils-libelf-0.145-1.fc11.i586
D: installing binary packages
D: closed db index /var/lib/rpm/Conflictname
D: closed db index /var/lib/rpm/Providename
D: closed db index /var/lib/rpm/Basenames
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv
D: opening db index /var/lib/rpm/Packages create mode=0x42
D: mounted filesystems:
D: i dev bsize bavail iavail mount point
D: 0 0x0000fd00 4096 49350090 14305164 /
D: 1 0x00000003 4096 0 -1 /proc
D: 2 0x00000000 4096 0 -1 /sys
D: 3 0x0000000a 4096 0 -1 /dev/pts
D: 4 0x00000802 1024 157064 51156 /boot
D: 5 0x00000010 4096 419374 214535 /dev/shm
D: 6 0x00000011 4096 0 -1 /proc/sys/fs/binfmt_misc
D: 7 0x00000012 4096 0 -1 /var/lib/nfs/rpc_pipefs
D: sanity checking 1 elements
D: opening db index /var/lib/rpm/Name create mode=0x42
D: read h# 1814 Header V3 RSA/SHA256 signature: OK, key ID d22e77f2
D: computing 2 file fingerprints
Preparing packages for installation...
D: computing file dispositions
D: opening db index /var/lib/rpm/Basenames create mode=0x42
package elfutils-libelf-0.145-1.fc11.i586 is already installed
D: closed db index /var/lib/rpm/Basenames
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
[root@desktop gcc-obj-dir]#
You can see that rpm claimed that elfutils-libelf-0.145-1.fc11.i586.rpm was already installed. A look at the source package elfutils-0.145-1.fc11.src.rpm shows loads of files in the libelf directory including gelf_xlatetom.c but a find on /usr revealed only:

[root@desktop LLJVM]# find /usr -name libelf -print
/usr/local/include/libelf
/usr/include/xulrunner-sdk-1.9.1/system_wrappers_js/libelf
/usr/include/xulrunner-sdk-1.9.1/system_wrappers/libelf
[root@desktop LLJVM]#

and a find on gelf_xlatetom.c revealed nothing:


[root@desktop SOURCES]# find /usr -name gelf_xlatetom.c -print
[root@desktop SOURCES]#
so I need to install the source package right but when I do something like rpm -ivv <package-name> everything just ends up in one of the /root/rpmbuild subdirectories and not where it's supposed to go. If I need to install the source rpm can someone please tell me how to do it. (I've never installed a source rpm before and the rpm manpage is not helpful here.)

Being essentially stuck I decided to make another clean copy of the gcc source dir and run config again from gcc-obj-dir. This showed two errors:

conftest.c:10:19: error: ppl_c.h: No such file or directory
conftest.c: In function 'main':
conftest.c:16: error: 'choke' undeclared (first use in this function)
conftest.c:16: error: (Each undeclared identifier is reported only once
conftest.c:16: error: for each function it appears in.)
conftest.c:16: error: expected ';' before 'me'
configure:5858: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include "ppl_c.h"
| int
| main ()
| {
|
|   #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR != 10
|   choke me
|   #endif
|
|   ;
|   return 0;
| }
configure:5862: result: no
configure:6092: checking how to run the C preprocessor
configure:6123: gcc -E  -I/usr/include/libelf conftest.c
configure:6123: $? = 0
configure:6137: gcc -E  -I/usr/include/libelf conftest.c
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
configure:6137: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:6162: result: gcc -E
configure:6182: gcc -E  -I/usr/include/libelf conftest.c
configure:6182: $? = 0
configure:6196: gcc -E  -I/usr/include/libelf conftest.c
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
configure:6196: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
A further look at config.log showed:

pplinc=''
ppllibs=''

so I decided I was missing ppllib. So then stupidly I installed ppl-0.10.2-2.fc11.i586.rpm and got this when I did the rpm command:


package ppl-0.10.2-7.fc11.i586 (which is newer than ppl-0.10.2-2.fc11.i586) is already installed
file /usr/bin/ppl-config from install of ppl-0.10.2-2.fc11.i586 conflicts with file from package ppl-0.10.2-7.fc11.i586
file /usr/lib/libppl.so.7.1.0 from install of ppl-0.10.2-2.fc11.i586 conflicts with file from package ppl-0.10.2-7.fc11.i586
file /usr/lib/libppl_c.so.2.1.0 from install of ppl-0.10.2-2.fc11.i586 conflicts with file from package ppl-0.10.2-7.fc11.i586
so I have to install the source rpm again right?

I still have no idea what the ac_nonexistent.h file is or whether the source for libelf (from elfutils-libelf) and ppllib should be installed under the top-level ggc source directory.

I'd be really grateful for any help. I hope I haven't forgot anything.

One last thing. Can someone point me to a document that documents how the gcc build process works/is structured in some detail?

Cheers,
Mike


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