Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lishdata-stress compilation failure when TARGET_FORCE_STATIC set #2

Open
hcodina opened this issue Jan 7, 2022 · 0 comments
Open

Comments

@hcodina
Copy link

hcodina commented Jan 7, 2022

Hi,

libshdata-stress fails to compile when TARGET_FORCE_STATIC is set.

Using:
export ALCHEMY_HOME=$(pwd)/alchemy
export ALCHEMY_TARGET_OUT=$(pwd)/out
ALCHEMY_WORKSPACE_DIR=$(pwd) TARGET_FORCE_STATIC=1 ${ALCHEMY_HOME}/scripts/alchemake V=1 libulog libfutils libshdata libshdata-stress

Lead to the following results:

Executable: libshdata-stress => out/build/libshdata-stress/libshdata-stress
c++ -O2  -m64  -L/home/hcodina/test_alchemy/out/staging/lib/x86_64-redhat-linux -L/home/hcodina/test_alchemy/out/staging/lib -L/home/hcodina/test_alchemy/out/staging/usr/lib/x86_64-redhat-linux -L/home/hcodina/test_alchemy/out/staging/usr/lib -Wl,-rpath-link=/home/hcodina/test_alchemy/out/staging/lib/x86_64-redhat-linux -Wl,-rpath-link=/home/hcodina/test_alchemy/out/staging/lib -Wl,-rpath-link=/home/hcodina/test_alchemy/out/staging/usr/lib/x86_64-redhat-linux -Wl,-rpath-link=/home/hcodina/test_alchemy/out/staging/usr/lib  -Wl,-Map,out/build/libshdata-stress/libshdata-stress.map  -Wl,--gc-sections -Wl,--as-needed   /home/hcodina/test_alchemy/out/build/libshdata-stress/obj/examples/stress_test.c.o /home/hcodina/test_alchemy/out/build/libshdata-stress/obj/examples/common.c.o   -Wl,--whole-archive  -Wl,--no-whole-archive   /home/hcodina/test_alchemy/out/staging/usr/lib/libshdata.a     /home/hcodina/test_alchemy/out/staging/usr/lib/libshdata-section-lookup.a     /home/hcodina/test_alchemy/out/staging/usr/lib/libfutils.a     /home/hcodina/test_alchemy/out/staging/usr/lib/libulog.a    -o out/build/libshdata-stress/libshdata-stress  -pthread -lrt 
/usr/bin/ld: /home/hcodina/test_alchemy/out/staging/usr/lib/libshdata-section-lookup.a(shd_lookup_default.c.o): in function `shd_section_lookup':
/home/hcodina/test_alchemy/libshdata/src/lookup/shd_lookup_default.c:41: undefined reference to `shd_shm_backend'
collect2: error: ld returned 1 exit status
make: *** [/home/hcodina/test_alchemy/alchemy/classes/EXECUTABLE/rules.mk:30: /home/hcodina/test_alchemy/out/build/libshdata-stress/libshdata-stress] Error 1

MAKE ERROR DETECTED
[hcodina@localhost test_alchemy]$ 

It seems that the issue is that libshdata-section-lookup.a reference a symbol present in libshdata.a.
In the link command line, the order used for .a files is libshdata.a then libshdata-section-lookup.a.
As the symbol is not used by libshdata.a itself or by the obj files, the linker discards the symbol before parsing ibshdata-section-lookup.a.

Best regards,
Herve Codina

buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Jan 11, 2022
The libshdata library provides lock free shared-memory tools.

https://github.com/Parrot-Developers/libshdata

libshdata-stress utility does not compile using static libs
only (BR2_STATIC_LIBS=y). The issue was raised upstream:
  Parrot-Developers/libshdata#2
For now, libshdata-stress simply depends on !BR2_STATIC_LIBS.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
[yann.morin.1998@free.fr:
  - do not macro-ify headers install
  - do not parameterise static libs install dest
  - do not parameterise binaries install dest
  - reorder macros decaration and use
  - remove spurious comma between module dependencies
  - implicit module name
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant