This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Rename pwait for LynxOS
DJ,
> The problem with your patch is that EVERY package which uses libiberty
> MUST use exactly the same detection macros as libiberty, else there
> will be versioning conflict. GCC is not the only package that uses
> libiberty.
I am not sure I understand what you mean by "versioning conflict". As
far as I know libiberty is a static library so you probably don't mean
versioning in the shared library sense.
If your problem is that on systems where pwait is "reserved" one can
now have a missing definition then I think this is just as bad as
having duplicate definitions which is the case currently. So I think
there are four situations:
1. pwait is not reserved, package has the pwait check
2. pwait is not reserved, package does not have the pwait check
3. pwait is reserved, package has the pwait check
4. pwait is reserved, package does not have the pwait check
With 1, 2, everything remains the same: pwait does not get renamed.
In case of 3 which is the case with gcc after the patch, pwait is
renamed to libiberty_pwait. In case of 4 before the patch one gets a
duplicate definition error. After the patch it results in an
undefined symbol but which now can be fixed by adding the check for
pwait into the package.
> What is it about the conflict that causes actual problems in gcc?
gcc -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fno-common -DHAVE_CONFIG_H -o Tcollect2 \
collect2.o tlink.o intl.o version.o ../libcpp/libcpp.a ../libbanshee/points-to/libandersen.a ../libbanshee/engine/libbansheeengine.a ../libbanshee/libcompat/libbansheecompat.a ../libiberty/libiberty.a
collect2: ld returned 1 exit status
/lib/libc.a(popen.as.o): In function `pwait':
popen.as.o(.text+0x2ef): multiple definition of `pwait'
../libiberty/libiberty.a(pex-unix.o)(.text+0x26c):/tmp/src/src/src/libiberty/pex-unix.c: first defined here /usr/i386-elf-lynxos/bin/ld: Warning: size of symbol `pwait' changed
from 24 to 22 in popen.as.o
collect2: ld returned 1 exit status
make[1]: *** [collect2] Error 1
make: *** [all-gcc] Error 2
And popen.as.o is included in the link because of the symbol system
referenced in tlink.o.
Adam