This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Minor ELF32/ia64 cleanup
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: hjl at lucon dot org
- Cc: wilson at specifixinc dot com, binutils at sources dot redhat dot com
- Date: Wed, 4 May 2005 14:42:44 -0700 (PDT)
- Subject: Re: PATCH: Minor ELF32/ia64 cleanup
Well, that patch got me farther. Now I die when compiling
bfd/elflink.c. HP-UX does have the ffs function, it's definition is in
<strings.h> which elflink.c apparently doesn't include. If I include
strings.h in elflink.c then I can build it
Then I got to opcodes/ia64-opc.c. I guess I need to add __hpux__ to
that long list of OS names that are already being checked in
include/libiberty.h to get the prototype version of basename and get rid
of that warning. It may be that I should be checking for __hpux__ and
GCC. Or maybe we should not check the OS versions at all if we know we
are using the GCC compiler? I think one of the reasons this is there at
all is to try and deal with the old bundled HP-UX C compiler that didn't
understand prototypes. The bundled compiler on IA64 does understand
prototypes so maybe checking for __hpux__ and __ia64__ would be another
way to go here.
Next I got to gas/config/tc-ia64.c where MIN is redefined (HP-UX defines
it in /usr/include/sys/param.h. So I changed this to only define MIN if
it is not already defined and then I was able to completely build gas
on IA64 HP-UX. But not binutils.
In binutils I got an implicit declaration of getc_unlocked when building
binutils/strings.c. HP-UX has this, but it is defined in stdio.h only
if _REENTRENT is defined so I get a warning about it because I am not
building with threads enabled and _REENTRENT is not defined. I think
this is an issue with how configure checks for the existence of
getc_unlocked. The routine exists, so configure sets HAVE_GETC_UNLOCKED
but I don't see the definition (and shouldn't use it) unless I also
set _REENTRENT. I am not sure what to do about this one. I will
set --enable-threads=posix for now so I can look for more problems.
That didn't work so I just temporarily commented out the call to
getc_unlocked and let it call getc and then I finished my build of
binutils.
Do you want to look at these issues too or should I try to make a
patch? I am not sure what the "right" fix is for some of them.
Steve Ellcey
sje@cup.hp.com
-----------------------------
bfd/elflink.c build failure:
/extra4/be/bin/gcc -DHAVE_CONFIG_H -I. -I/shale/sje/binutils_patch/src/bfd -I. -
D_GNU_SOURCE -I. -I/shale/sje/binutils_patch/src/bfd -I/shale/sje/binutils_patch
/src/bfd/../include -I/shale/sje/binutils_patch/src/bfd/../intl -I../intl -W -Wa
ll -Wstrict-prototypes -Wmissing-prototypes -Werror -g -c /shale/sje/binutils_pa
tch/src/bfd/elflink.c -o elflink.o
/shale/sje/binutils_patch/src/bfd/elflink.c: In function `elf_link_add_object_sy
mbols':
/shale/sje/binutils_patch/src/bfd/elflink.c:3907: warning: implicit declaration
of function `ffs'
-----------------------------
opcodes/ia64-opc.c build failure:
in file included from /shale/sje/binutils_patch/src/opcodes/ia64-opc.c:23:
/shale/sje/binutils_patch/src/opcodes/../include/libiberty.h:100: warning: funct
ion declaration isn't a prototype
make[3]: *** [ia64-opc.lo] Error 1
gas/config/tc-ia64.c build failure:
/shale/sje/binutils_patch/src/gas/config/tc-ia64.c:59:1: "MIN" redefined
In file included from /usr/include/limits.h:434,
from /shale/sje/extra4/be/bin/../lib/gcc/ia64-hp-hpux11.20/3.4.
2/include/limits.h:122,
from /shale/sje/extra4/be/bin/../lib/gcc/ia64-hp-hpux11.20/3.4.
2/include/syslimits.h:7,
from /shale/sje/extra4/be/bin/../lib/gcc/ia64-hp-hpux11.20/3.4.
2/include/limits.h:11,
from /usr/include/locale.h:79,
from /shale/sje/binutils_patch/src/gas/asintl.h:24,
from /shale/sje/binutils_patch/src/gas/as.h:198,
from /shale/sje/binutils_patch/src/gas/config/tc-ia64.c:45:
/usr/include/sys/param.h:442:1: this is the location of the previous definition
make[3]: *** [tc-ia64.o] Error 1
-----------------------------
binutils/strings.c build failure
/extra4/be/bin/gcc -DHAVE_CONFIG_H -I. -I/shale/sje/binutils_patch/src/binutils
-I. -D_GNU_SOURCE -I. -I/shale/sje/binutils_patch/src/binutils -I../bfd -I/shale
/sje/binutils_patch/src/binutils/../bfd -I/shale/sje/binutils_patch/src/binutils
/../include -I/shale/sje/binutils_patch/src/binutils/../intl -I../intl -DLOCALED
IR="\"/shale/sje/ia64_fsf_b/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_em
ulation -D_LARGEFILE64_SOURCE -W -Wall -Wstrict-prototypes -Wmissing-prototypes
-Werror -g -c /shale/sje/binutils_patch/src/binutils/strings.c
/shale/sje/binutils_patch/src/binutils/strings.c: In function `get_char':
/shale/sje/binutils_patch/src/binutils/strings.c:451: warning: implicit declarat
ion of function `getc_unlocked'
make[3]: *** [strings.o] Error 1