Am 04.11.2013 um 18:03 schrieb Rafael Ostertag <[email protected]>:
> Hi Dago
>
> On Mon, Nov 04, 2013 at 05:44:09PM +0100, Dagobert Michelsen wrote:
>> Hi Rafi,
>>
>>> Could it be related to the buildfarm update?
>>
>>
>> Probably, the T5220 is now running 105400-04 whereas unstable10x is still
>> running 147441-19.
>> Should I update the x86 machines also? My impression is to patch as less as
>> possible to
>> not introduce new linker symbol anomalies. The patch on the farm was needed
>> to fix an ugly
>> bug in zfs which prevented us from doing backups, so no option of not
>> installing ;-)
>
> If it is related to Solaris patches, patching x86 would mean that `-z ignore'
> might not work on x86 anymore, as well. So, wouldn't it be smarter, to figure
> out why it stopped working on sparc?
It is sill working. Here’s an example where I’m linking a program with a
library that is linked with another libary but doesn’t use any of it’s
functions.
slowfranklin@unstable10s [unstable10s]:~ > for file in Makefile main.c lib.c
anotherlib.c ; do echo $file\: ; cat $file; done
Makefile:
ALIB_LDFLAGS=
LIB_LDFLAGS=-z ignore -B direct
LDFLAGS=-z ignore -B direct
all: main
libanotherlib.so: anotherlib.c
LD_OPTIONS="$(ALIB_LDFLAGS)" gcc -shared -o libanotherlib.so -fPIC
anotherlib.c
libmylib.so: lib.c libanotherlib.so
LD_OPTIONS="$(LIB_LDFLAGS)" gcc -shared -o libmylib.so -fPIC lib.c -L.
-R. -lanotherlib
main: main.c libmylib.so
LD_OPTIONS="$(LDFLAGS)" gcc -o main main.c -L. -R. -lmylib
clean:
rm main libmylib.so libanotherlib.so
main.c:
int main(int argc, char **argv)
{
func("test");
}
lib.c:
#include <stdio.h>
void func(const char *msg)
{
printf("%s\n", msg);
}
anotherlib.c:
#include <stdio.h>
void anotherfunc(const char *msg)
{
printf("%s\n", msg);
}
slowfranklin@unstable10s [unstable10s]:~ > make clean
rm main libmylib.so libanotherlib.so
slowfranklin@unstable10s [unstable10s]:~ > make
LD_OPTIONS="" gcc -shared -o libanotherlib.so -fPIC anotherlib.c
LD_OPTIONS="-z ignore -B direct" gcc -shared -o libmylib.so -fPIC lib.c -L. -R.
-lanotherlib
LD_OPTIONS="-z ignore -B direct" gcc -o main main.c -L. -R. -lmylib
slowfranklin@unstable10s [unstable10s]:~ > elfdump -d main | grep NEED
[1] NEEDED 0x11b libmylib.so
[2] NEEDED 0x105 libc.so.1
[13] VERNEED 0x106d8
[14] VERNEEDNUM 0x1
slowfranklin@unstable10s [unstable10s]:~ >