binutils + xlc + POWER4 ==> Segmentation fault (core dumped)
francois.petitjean@bureauveritas.com
francois.petitjean@bureauveritas.com
Mon Mar 26 15:54:00 GMT 2007
More information about the Binutils mailing list
Mon Mar 26 15:54:00 GMT 2007
- Previous message (by thread): FRV registers patch
- Next message (by thread): [PATCH] increasing the 64 bits portability of binutils/size.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On an AIX 5.2 machine (4 CPUs, 64 bits hardware but 32 bits kernel) I have tried to compile binutils (the 2.17 release and the binutils-070315 snapshot). configuration with : fp2@halc10:/u/fp2/dev_c/binutils-070315 $ env AR=/usr/ccs/bin/ar CC=/u/fp2/bin/mxlc ./configure --prefix=/opt/freeware --enable-commonbfdlib --enable-shared -- d isable-static --disable-nls checking build system type... powerpc-ibm-aix5.2.0.0 checking host system type... powerpc-ibm-aix5.2.0.0 checking target system type... powerpc-ibm-aix5.2.0.0 checking for a BSD-compatible install... /opt/freeware/bin/install -c checking whether ln works... yes checking whether ln -s works... yes .... checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f 2 *** This configuration is not supported in the following subdirectories: gprof (Any other directories should still work fine.) checking for bison... bison -y ... /u/fp2/bin/mxlc -c -DHAVE_CONFIG_H -I. -I.././libiberty/../include .././libib erty/pex-common.c -o pex-common.o ".././libiberty/config.h", line 435.9: 1506-213 (S) Macro name inline cannot be redefined. ".././libiberty/config.h", line 435.9: 1506-358 (I) "inline" is defined on line 182 of .././libiberty/../include/ansidecl.h. make[2]: *** [pex-common.o] Error 1 make[2]: Leaving directory `/net/ghzn8/homea/fp2/dev_c/binutils-070315/libiberty ' make[1]: *** [all-libiberty] Error 2 To solve this, in libiberty I have modified config.in to add a double include guard : /* config.in. Generated from configure.ac by autoheader. */ #ifndef H_CONGIG_H #define H_CONGIG_H .... /* Define as `fork' if `vfork' does not work. */ #undef vfork #endif /* H_CONFIG_H */ I noticed also a warnig : /u/fp2/bin/mxlc -c -DHAVE_CONFIG_H -I. -I.././libiberty/../include .././libiberty/regex.c -o regex.o ".././libiberty/regex.c", line 31.3: 1506-224 (I) Incorrect pragma ignored. Modified : #if defined _AIX && !defined __GNUC__ && !defined REGEX_MALLOC #include <alloca.h> /* #pragma alloca */ #endif (See le /usr/include/alloca.h at the end of this message) in binutils ... creating size /u/fp2/bin/mxlc -DHAVE_CONFIG_H -I. -I.././binutils -I. -D_GNU_SOURCE -I. -I../. /binutils -I../bfd -I.././binutils/../bfd -I.././binutils/../include -DLOCALEDIR ="\"/opt/freeware/share/locale\"" -DREPORT_BUGS_TO=" \"<URL:http://www.sourceware .org/bugzilla/>\"" -Dbin_dummy_emulation=bin_aix5_emulation -c -DAIX_WEAK_SU PPORT .././binutils/objdump.c ".././binutils/objdump.c", line 2829.68: 1506-280 (E) Function argument assignme nt between types "void*" and "char*(*)(struct bfd*,const char*)" is not allowed. make[4]: *** [objdump.o] Error 1 if (! print_debugging_info (stdout, dhandle, abfd, syms, (void *)demangle,, /u/fp2/bin/mxlc -DHAVE_CONFIG_H -I. -I.././binutils -I. -D_GNU_SOURCE -I. -I.././binutils -I../bfd -I.././binutils/../bfd -I.././binutils/../include -DLOCALEDIR="\"/opt/freeware/share/locale\"" -DREPORT_BUGS_TO=" \"<URL:http://www.sourceware.org/bugzilla/>\"" -Dbin_dummy_emulation=bin_aix5_emulation -c prdbg.c "prdbg.c", line 307.18: 1506-068 (E) Operation between types "char*(*)(struct bfd*,const char*)" and "void*" is not allowed. make[2]: *** [prdbg.o] Error 1 make[2]: Leaving directory `/net/ghzn8/homea/fp2/dev_c/binutils-070315/binutils' make[1]: *** [all-recursive] Error 1 fp2@halc10:/u/fp2/dev_c $ cat /tmp/prdbg.patch --- binutils-070315/binutils/prdbg.c 2006-09-28 14:59:25.000000000 +0200 +++ binutils-070315/binutils/prdbg.n.c 2007-03-26 15:18:46.000000000 +0200 @@ -34,6 +34,7 @@ #include "budbg.h" /* This is the structure we use as a handle for these routines. */ +typedef char *(*demangler_fn) (bfd *, const char *); struct pr_handle { @@ -53,7 +54,8 @@ /* The symbols table for this BFD. */ asymbol **syms; /* Pointer to a function to demangle symbols. */ - char *(*demangler) (bfd *, const char *); +/* char *(*demangler) (bfd *, const char *); */ + demangler_fn demangler; }; /* The type stack. */ @@ -304,7 +306,7 @@ info.filename = NULL; info.abfd = abfd; info.syms = syms; - info.demangler = demangler; + info.demangler = (demangler_fn) demangler; if (as_tags) { fp2@halc10:/u/fp2/dev_c $ cd binutils-070315/binutils/ And now the most intersting part : fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ ./size --version GNU size (GNU Binutils) 070315.20070315 Copyright 2007 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ l .libs/ sh: l: command not found fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ alias l='ls -lApst' fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ alias l='ls -lApst'.............. ......[11Pl .libs/ total 2284 60 -rwxr-xr-x 1 fp2 staff 59303 Mar 26 14:35 lt-size 148 -rwxr-xr-x 1 fp2 staff 149303 Mar 26 14:34 cxxfilt 456 -rwxr-xr-x 1 fp2 staff 466804 Mar 26 14:34 strip-new 176 -rwxr-xr-x 1 fp2 staff 178945 Mar 26 14:34 nm-new 152 -rwxr-xr-x 1 fp2 staff 153761 Mar 26 14:33 addr2line 456 -rwxr-xr-x 1 fp2 staff 466778 Mar 26 14:33 objcopy 96 -rwxr-xr-x 1 fp2 staff 96643 Mar 26 14:33 ranlib 56 -rwxr-xr-x 1 fp2 staff 57292 Mar 26 14:33 strings 96 -rwxr-xr-x 1 fp2 staff 96617 Mar 26 14:33 ar 528 -rwxr-xr-x 1 fp2 staff 540178 Mar 26 14:33 objdump 60 -rwxr-xr-x 1 fp2 staff 59281 Mar 26 13:36 size fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ ./size .libs/size Segmentation fault (core dumped) fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ /usr/bin/size .libs/size .libs/size: 23024 + 4280 + 120 + 3922 = 31346 fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ cc -o size2 size.o bucomm.o version.o filemode.o -L../bfd/.libs -lbfd ../libiberty/libiberty.a -blibpath:/u/fp2/dev_c/binutils-070315/bfd/.libs:/usr/lib:/lib fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ l size2 60 -rwxr-xr-x 1 fp2 staff 59303 Mar 26 14:55 size2 fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ ./size2 size2 Segmentation fault (core dumped) fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ ./size2 --version GNU size (GNU Binutils) 070315.20070315 Copyright 2007 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ dbx size2 Type 'help' for help. [using memory image in core] reading symbolic information ...warning: no source compiled with -g Segmentation fault in objalloc_create at 0xd34ff880 0xd34ff880 (objalloc_create+0x8) 800c0000 lwz r0,0x0(r12) (dbx) where objalloc_create() at 0xd34ff880 _bfd_new_bfd() at 0xd34f9a74 bfd_fopen() at 0xd34fac94 display_file() at 0x100013d8 main() at 0x10000744 (dbx) ^D (dbx) quit Here is the content of the mxlc script : fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ cat /u/fp2/bin/mxlc #!/bin/sh # mxlc front end à xlc pour faire croire à configure que xlc -g nest pas acceptable for option do if test "$option" = "-g"; then echo '1506-173 (W) Option -g is not valid. Enter xlc for list of valid options.' exit 2 fi if test "$option" = "--version"; then echo 'VisualAge C++ Professional / C for AIX Compiler, Version 6' exit 0 fi if test "$option" = "-v"; then echo 'VisualAge C++ Professional / C for AIX Compiler, Version 6' exit 0 fi if test "$option" = "-V"; then echo 'VisualAge C++ Professional / C for AIX Compiler, Version 6' exit 0 fi done pgm="/usr/vacpp/bin/cc -O3 -qstrict -qarch=rs64c -qtune=rs64c -qhalt=e -qlanglvl=ansi -qmaxerr=1" # pgm="/usr/vacpp/bin/cc -O3 -qstrict -qarch=rs64c -qtune=rs64c -qhalt=e -qlanglvl=ansi -qwarn64" # xeq=exec exec $pgm $@ fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ I must say that the values for -qarch and -qtune were obtained by running the hwinfo program in the examples of the "AIX 5L porting guide" (a redbook sg246034.pdf). The -qwarn64 option produces a lot of warnings, and it is impossible to compile binutils as a 64 bits library : with -q64 option, the __64BIT__ symbol is defined ans some 32 bits structures are not defined and bfd/rs6000-core.c needs them. The configure option --enable-commonbfdlib is not listed in --help (in the top level directory) but only in the bfd/.. sub directories. fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ cat /usr/include/alloca.h /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ .... /* IBM_PROLOG_END_TAG */ /* @(#)78 1.1 src/bos/usr/include/alloca.h, incsys, bos520 3/6/01 08:38:39 */ #ifndef _H_ALLOCA #define _H_ALLOCA #include <sys/types.h> #ifdef __cplusplus extern "C" { #endif #ifdef __GNUC__ /* Remove any previous definitions. */ #undef alloca #define alloca(size) __builtin_alloca (size) #else /* xlc */ #pragma alloca #endif /* GCC. */ #ifdef __cplusplus } #endif #endif /* _H_ALLOCA */ fp2@halc10:/u/fp2/dev_c/binutils-070315/binutils $ Please note that on AIX 5L the souece libiberty/alloca.c is not needed. Regards. PS: sorry for bad english. PS2 : By reading the following warning you will understand that it is impossible to access a cvs repository and please consider to move to subversion with a HTTP/Webdav access. PS3 : I had some hope when seeing a power4 related modification in the Changelog but it seems that the problem reamains. NOTICE: This message contains information which is confidential and the copyright of our company or a third party. If you are not the intended recipient of this message please delete it and destroy all copies. If you are the intended recipient of this message you should not disclose or distribute this message to third parties without the consent of our company. Our company does not represent, warrant and/or guarantee that the integrity of this message has been maintained nor that the communication is free of virus, interception or interference. The liability of our company is limited by our General Conditions of Services. Nota : Ce message contient des informations confidentielles propriété de notre société et/ou d'un tiers. Si vous n'êtes pas parmi les destinataires désignés de ce message, merci de l'effacer ainsi que toutes ses copies. Si vous êtes parmi les destinataires désignés de ce message, prière de ne pas le divulguer ni de le transmettre à des tiers sans l'accord de notre société. Notre société ne peut garantir que l'intégrité de ce message a été préservée ni que la présente communication est sans virus, interception ou interférence. La responsabilité de notre société est limitée par nos Conditions Générales de Services.
- Previous message (by thread): FRV registers patch
- Next message (by thread): [PATCH] increasing the 64 bits portability of binutils/size.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list