Modify

Opened 2 years ago

Closed 2 years ago

#21708 closed defect (fixed)

building with cmake - can't detect shared libraries

Reported by: arturo@… Owned by: developers
Priority: normal Milestone:
Component: packages Version: Trunk
Keywords: Cc:

Description

building with cmake - can't detect shared libraries

Hello guys, I have bumped into this issue when building this custom library for my own fork :

https://github.com/artynet/openwrt/blob/gcc5-01/package/linino/arcus/Makefile

it relies on the "protobuf" library as dependency, of which I rewrote the Makefile :

https://github.com/artynet/openwrt/blob/gcc5-01/package/linino/protobuf/Makefile

to distinguish the actual EXE and the libraries from each other. The fact is that with the new definition of the
STAGING_DIR_HOST env variable set as :

$(STAGING_DIR)/host

the shared libraries are not detected anymore but instead, the native host ones are ! Take a look at the log :

Scanning dependencies of target Arcus
make[5]: Leaving directory `/home/arturo/temp/openwrt-arty/build_dir/target-mips_34kc_musl-1.1.11/libArcus-15.06.03'
make[5]: Entering directory `/home/arturo/temp/openwrt-arty/build_dir/target-mips_34kc_musl-1.1.11/libArcus-15.06.03'
[ 12%] Building CXX object CMakeFiles/Arcus.dir/src/Socket.cpp.o
[ 25%] Building CXX object CMakeFiles/Arcus.dir/src/SocketListener.cpp.o
[ 37%] Linking CXX shared library libArcus.so
/home/arturo/temp/openwrt-arty/staging_dir/target-mips_34kc_musl-1.1.11/host/lib/libprotobuf.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[5]: *** [libArcus.so.15.05.90] Error 1
make[5]: Leaving directory `/home/arturo/temp/openwrt-arty/build_dir/target-mips_34kc_musl-1.1.11/libArcus-15.06.03'
make[4]: *** [CMakeFiles/Arcus.dir/all] Error 2
make[4]: Leaving directory `/home/arturo/temp/openwrt-arty/build_dir/target-mips_34kc_musl-1.1.11/libArcus-15.06.03'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/arturo/temp/openwrt-arty/build_dir/target-mips_34kc_musl-1.1.11/libArcus-15.06.03'
make[2]: *** [/home/arturo/temp/openwrt-arty/build_dir/target-mips_34kc_musl-1.1.11/libArcus-15.06.03/.built] Error 2
make[2]: Leaving directory `/home/arturo/temp/openwrt-arty/package/linino/arcus'
make[1]: *** [package/linino/arcus/compile] Error 2
make[1]: Leaving directory `/home/arturo/temp/openwrt-arty'
make: *** [package/arcus/compile] Error 2

Since the cmake builds are always peculiar ones, I was wondering if I have to pass an additional switch the the cmake configure step to reflect the
new changes in the trunk itself, any ideas on that ?

this behaviour in my opinion will break all the future library-dependent cmake builds...thanks in advance...

Regards, Arturo

Attachments (0)

Change History (4)

comment:1 Changed 2 years ago by nbd

please try latest trunk, I just made some fixes

comment:2 Changed 2 years ago by anonymous

ok thanks, i'll make a rebase on the latest trunk and retry. I'll let you know as soon as I finish.

thank you again....

comment:3 Changed 2 years ago by arty.net

Thank you Felix, your fix has solved my issue. A simple rebase on the latest trunk did the trick.

The issue can now be closed. Thanks, Arturo.

comment:4 Changed 2 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.