build: use a different method to expose symbols
.. the old method doesn't work on aarch64 and apparently caused problem with powerpc back in the day. The new method has been tested to work on amd64 and aarch64 and is expected to be more portable: it is the normal method used to select the symbols visible in a shared library. (I don't have a powerpc to test with) Signed-off-by: Jeff Epler <jepler@unpythonic.net>
This commit is contained in:
parent
00aff4a53e
commit
e4b94a5df9
2 changed files with 5 additions and 6 deletions
|
|
@ -962,9 +962,8 @@ modules: $(patsubst %.o,../rtlib/%.so,$(obj-m))
|
|||
../rtlib/%.so:
|
||||
$(ECHO) Linking $@
|
||||
$(Q)ld -d -r -o objects/$*.tmp $^
|
||||
@if ! $(IS_POWERPC); then objcopy -j .rtapi_export -O binary objects/$*.tmp objects/$*.exp; fi
|
||||
@if ! $(IS_POWERPC); then objcopy -G __x86.get_pc_thunk.bx -G __i686.get_pc_thunk.bx `xargs -r0n1 echo -G < objects/$*.exp | grep -ve '^-G $$' | sort -u` objects/$*.tmp; fi
|
||||
$(Q)$(CC) -shared -Bsymbolic $(LDFLAGS) -o $@ objects/$*.tmp -lm
|
||||
$(Q)(echo '{ global : '; objcopy -j .rtapi_export -O binary objects/$*.tmp /dev/stdout | tr -s '\0' | xargs -r0 printf '%s;\n' | grep .; echo 'local : * ; };') > objects/$*.ver
|
||||
$(Q)$(CC) -shared -Bsymbolic $(LDFLAGS) -Wl,--version-script,objects/$*.ver -o $@ $^ -lm
|
||||
|
||||
RTFLAGS += -fno-strict-aliasing -fwrapv
|
||||
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@ IS_POWERPC = test `uname -m` = ppc -o `uname -m` = ppc64
|
|||
%.so:
|
||||
$(ECHO) Linking $@
|
||||
$(Q)ld -d -r -o $*.tmp $^
|
||||
$(Q)if ! $(IS_POWERPC); then objcopy -j .rtapi_export -O binary $*.tmp $*.exp; fi
|
||||
$(Q)if ! $(IS_POWERPC); then objcopy -G __x86.get_pc_thunk.bx -G __i686.get_pc_thunk.bx `xargs -r0n1 echo -G < $*.exp | grep -ve '^-G $$' | sort -u` $*.tmp; fi
|
||||
$(Q)$(CC) -shared -Bsymbolic $(LDFLAGS) -o $@ $*.tmp -lm
|
||||
$(Q)(echo '{ global : '; objcopy -j .rtapi_export -O binary $*.tmp /dev/stdout | tr -s '\0' | xargs -r0 printf '%s;\n' | grep .; echo 'local : * ; };') > $*.ver
|
||||
$(Q)$(CC) -shared -Bsymbolic $(LDFLAGS) -Wl,--version-script,$*.ver -o $@ $^ -lm
|
||||
$(Q)ld -d -r -o $*.tmp $^
|
||||
endif
|
||||
|
||||
ifeq ($(BUILDSYS),normal)
|
||||
|
|
|
|||
Loading…
Reference in a new issue