Ticket #638 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

irmc-sync: fails to build on some GNU/Linux architectures trying to link unrelocatable libbfb.a

Reported by: mbanck Owned by: cstender
Priority: normal Milestone:
Component: Plugin: irmc Version: 0.34
Severity: normal Keywords:
Cc:

Description

irmc-sync fails to build on some GNU/Linux architecture:

[100%] Building C object src/CMakeFiles/irmc-sync.dir/irmc_obex.o /usr/bin/cc -Dirmc_sync_EXPORTS -g -Wall -O2 -O2 -g -fPIC -I/build/buildd/libopensync-plugin-irmc-0.34 -I/build/buildd/libopensync-plugin-irmc-0.34/build -I/build/buildd/libopensync-plugin-irmc-0.34/src/bfb -I/build/buildd/libopensync-plugin-irmc-0.34/src -I/usr/include/opensync-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0/glib -I/usr/include/glib-2.0/gobject -I/usr/include/libxml2 -o src/CMakeFiles/irmc-sync.dir/irmc_obex.o -c /build/buildd/libopensync-plugin-irmc-0.34/src/irmc_obex.c Linking C shared module irmc-sync.so cd /build/buildd/libopensync-plugin-irmc-0.34/build/src && /usr/bin/cmake -P CMakeFiles/irmc-sync.dir/cmake_clean_target.cmake cd /build/buildd/libopensync-plugin-irmc-0.34/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/irmc-sync.dir/link.txt --verbose=1 /usr/bin/cc -fPIC -g -Wall -O2 -O2 -g -shared -Wl,-soname,irmc-sync.so -o irmc-sync.so "CMakeFiles/irmc-sync.dir/irmc_sync.o" "CMakeFiles/irmc-sync.dir/cobex_bfb.o" "CMakeFiles/irmc-sync.dir/irmc_bluetooth.o" "CMakeFiles/irmc-sync.dir/irmc_irda.o" "CMakeFiles/irmc-sync.dir/irmc_obex.o" -L/build/buildd/libopensync-plugin-irmc-0.34/build/src/bfb -lopensync -lopenobex -lbluetooth -lglib-2.0 -lgmodule-2.0 -lgthread-2.0 -lgobject-2.0 -lxml2 -Wl,-Bstatic -lbfb -Wl,-Bdynamic -lopenobex -lglib-2.0 -lgmodule-2.0 -lgthread-2.0 -lgobject-2.0 /usr/bin/ld: /build/buildd/libopensync-plugin-irmc-0.34/build/src/bfb/libbfb.a(crc.o): gp-relative relocation against dynamic symbol irda_crc16_table /usr/bin/ld: /build/buildd/libopensync-plugin-irmc-0.34/build/src/bfb/libbfb.a(crc.o): gp-relative relocation against dynamic symbol irda_crc16_table /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status make[3]: * [src/irmc-sync.so] Error 1 make[3]: Leaving directory `/build/buildd/libopensync-plugin-irmc-0.34/build'

(from http://experimental.ftbfs.de/fetch.php?&pkg=libopensync-plugin-irmc&ver=0.34-2&arch=alpha&stamp=1195805578&file=log&as=raw )

This is because bfb/CMakeLists.txt has the STATIC tag for the bfb target, and it is not allowed to link in non-relocatable code (i.e., code not compiled with -fPIC) for shared objects (irmc-sync.so).

Change History

comment:1 Changed 6 years ago by mbanck

Proposed fix:

--- libopensync-plugin-irmc-0.34.orig/src/bfb/CMakeLists.txt +++ libopensync-plugin-irmc-0.34/src/bfb/CMakeLists.txt @@ -9,5 +9,7 @@

ADD_LIBRARY( bfb STATIC ${bfb_LIB_SRCS} )

+SET_TARGET_PROPERTIES( bfb PROPERTIES COMPILE_FLAGS "-fPIC") +

TARGET_LINK_LIBRARIES( bfb ${OPENOBEX_LIBRARIES} ${GLIB2_LIBRARIES} )

comment:2 Changed 6 years ago by cstender

  • Milestone set to OpenSync 0.40

is this fixed with r2883?

comment:3 Changed 6 years ago by prahal

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.