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

meson 0.52.1 breaking shared linking with D #6359

Closed
Cogitri opened this issue Dec 17, 2019 · 11 comments · Fixed by #6356
Closed

meson 0.52.1 breaking shared linking with D #6359

Cogitri opened this issue Dec 17, 2019 · 11 comments · Fixed by #6356

Comments

@Cogitri
Copy link
Contributor

Cogitri commented Dec 17, 2019

Describe the bug
Since meson 0.52.1 building my project does succeed, but running the resulting binary doesn't work. See the following ldd output:

	/lib/ld-musl-x86_64.so.1 (0x7f1f79f0c000)
Error loading shared library source/corecollector/libcorecollector.so.0.0.1: No such file or directory (needed by /usr/bin/corectl)
	libhunt.so.0 => /usr/local/lib/libhunt.so.0 (0x7f1f7999e000)
	libphobos2-ldc-shared.so.88 => /usr/lib/libphobos2-ldc-shared.so.88 (0x7f1f7952e000)
	libdruntime-ldc-shared.so.88 => /usr/lib/libdruntime-ldc-shared.so.88 (0x7f1f79419000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f1f79405000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f1f79f0c000)

With meson 0.51.2 this works:

ldd /usr/bin/corectl
	/lib/ld-musl-x86_64.so.1 (0x7fe1af538000)
	libcorecollector.so.0 => /usr/lib/libcorecollector.so.0 (0x7fe1af409000)
	libhunt.so.0 => /usr/local/lib/libhunt.so.0 (0x7fe1aef15000)
	libphobos2-ldc-shared.so.88 => /usr/lib/libphobos2-ldc-shared.so.88 (0x7fe1aeaa5000)
	libdruntime-ldc-shared.so.88 => /usr/lib/libdruntime-ldc-shared.so.88 (0x7fe1ae990000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fe1ae97c000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fe1af538000)

To Reproduce
Build https://github.com/Cogitri/corecollector

system parameters
Native build on Alpine Linux Edge with meson 0.52.1. Tested with latest scm (being 585ccfc) too.

@Cogitri
Copy link
Contributor Author

Cogitri commented Dec 23, 2019

Apparently this only happens with ldc, gonna start bisecting...

@Cogitri
Copy link
Contributor Author

Cogitri commented Dec 23, 2019

I think this is due to 49d20a5.

@Cogitri
Copy link
Contributor Author

Cogitri commented Dec 23, 2019

So get_soname_args returns '-L=-L-soname,libcorecollector.so.0' when it should return '-L=-Wl,-soname,libcorecollector.so.0'

@Cogitri
Copy link
Contributor Author

Cogitri commented Dec 23, 2019

Actually nevermind, it's due to 0efab59

@dcbaker
Copy link
Member

dcbaker commented Mar 9, 2020

I was able to compile your project with #6359 applied, can you confirm?

@Cogitri
Copy link
Contributor Author

Cogitri commented Mar 9, 2020

Ah sure, I'll give it a go, thanks. Also, can I maybe help with tests for the D lang?

@Cogitri
Copy link
Contributor Author

Cogitri commented Mar 9, 2020

The project does compile (it also compiled before that change), the problem is the linkage. If I run a binary compiled with ldc2 with (or without this change) on meson >0.51.2 the binary blows up with:

corectl list
Error loading shared library source/corecollector/libcorecollector.so.0.3.1: No such file or directory (needed by /usr/local/bin/corectl)
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump11CoredumpDir6__ctorMFxAyaxbZCQCcQBqQBk: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7logging24InvalidLogLevelException6__ctorMFNfAyaQdmZCQCqQCeQBz: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7logging12setupLoggingFNfxE3std12experimental6logger4core8LogLevelSQBo5stdio4FileZv: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump6getGidFZk: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration13Configuration6__ctorMFZCQCeQBsQBg: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump8Coredump20generateCoredumpNameMxFNfZAya: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump6getUidFZk: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump11CoredumpDir6__initZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump11CoredumpDir7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7globals10libexecDiryAa: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration13Configuration7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump11CoredumpDir6__vtblZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration13Configuration6__vtblZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7logging24InvalidLogLevelException6__initZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7globals5groupyAa: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7globals20corecollectorVersionyAa: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7logging24InvalidLogLevelException7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7logging24InvalidLogLevelException7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7logging24InvalidLogLevelException6__vtblZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7globals4useryAa: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration13Configuration6__initZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration10configPathyAa: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration12__ModuleInfoZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration12__ModuleInfoZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump12__ModuleInfoZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump12__ModuleInfoZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector7logging12__ModuleInfoZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration32UnknownKeyConfigurationException7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector13configuration33MissingFileConfigurationException7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump13NoCoredumpDir7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump18NoPermsCoredumpDir7__ClassZ: symbol not found
Error relocating /usr/local/bin/corectl: _D13corecollector8coredump22NoCompressionException7__ClassZ: symbol not found

The shared library shouldn't be source/corecollector/libcorecollector.so.0.3.1 , instead it should be libcorecollector.so.0.3.1. I reproduced this like so:

meson.py build && env DESTDIR=$(pwd)/install ninja -C build install && ./install/usr/local/bin/corectl -h

Here's a verbose log of the compilation

[1/57] ldc2 -I=tests/59830eb@@test-add-core@exe -I=tests -I=../tests -enable-color -wi -g -d-debug -of='tests/59830eb@@test-add-core@exe/testAddCore.d.o' -c ../tests/testAddCore.d
[2/57] ldc2 -I=tests/59830eb@@corecollector-lib-test@sta -I=tests -I=../tests -enable-color -wi -g -d-debug -of='tests/59830eb@@corecollector-lib-test@sta/libTest.d.o' -c ../tests/libTest.d
[3/57] ldc2 -I=tests/59830eb@@crashing_test_exe@exe -I=tests -I=../tests -enable-color -wi -g -d-debug -of='tests/59830eb@@crashing_test_exe@exe/crash.d.o' -c ../tests/crash.d
[4/57] ldc2 -I=source/41cf679@@test_corectlcorectl_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corectlcorectl_d_exe@exe/corectl_corectl.d.o' -c ../source/corectl/corectl.d
[5/57] ldc2 -I=source/41cf679@@test_corectlcorectl_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corectlcorectl_d_exe@exe/corecollector_lib.d.o' -c ../source/corecollector/lib.d
[6/57] ldc2 -I=source/41cf679@@test_corectloptions_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corectloptions_d_exe@exe/corectl_options.d.o' -c ../source/corectl/options.d
[7/57] ldc2 -I=source/41cf679@@test_corectloptions_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corectloptions_d_exe@exe/corecollector_lib.d.o' -c ../source/corecollector/lib.d
[8/57] ldc2 -I=source/41cf679@@test_corehelpercorehelper_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corehelpercorehelper_d_exe@exe/corehelper_options.d.o' -c ../source/corehelper/options.d
[9/57] ldc2 -I=source/41cf679@@test_corehelpercorehelper_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corehelpercorehelper_d_exe@exe/corehelper_corehelper.d.o' -c ../source/corehelper/corehelper.d
[10/57] ldc2 -I=source/41cf679@@test_corehelpercorehelper_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corehelpercorehelper_d_exe@exe/corecollector_lib.d.o' -c ../source/corecollector/lib.d
[11/57] ldc2 -I=source/41cf679@@test_corehelperoptions_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corehelperoptions_d_exe@exe/corehelper_options.d.o' -c ../source/corehelper/options.d
[12/57] ldc2 -I=source/41cf679@@test_corehelperoptions_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -unittest -d-version=unittest_manual -of='source/41cf679@@test_corehelperoptions_d_exe@exe/corecollector_lib.d.o' -c ../source/corecollector/lib.d
[13/57] ldc2 -I=source/41cf679@@test_libcorecollectorlogging_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -J/home/rasmus/Projects/corecollector/source/corecollector/views -unittest -d-version=unittest_manual -of='source/41cf679@@test_libcorecollectorlogging_d_exe@exe/corecollector_logging.d.o' -c ../source/corecollector/logging.d
[14/57] ldc2 -I=source/41cf679@@test_libcorecollectorlogging_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -J/home/rasmus/Projects/corecollector/source/corecollector/views -unittest -d-version=unittest_manual -of='source/41cf679@@test_libcorecollectorlogging_d_exe@exe/corecollector_lib.d.o' -c ../source/corecollector/lib.d
[15/57] ldc2 -I=source/41cf679@@test_libcorecollectorcoredump_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -J/home/rasmus/Projects/corecollector/source/corecollector/views -unittest -d-version=unittest_manual -of='source/41cf679@@test_libcorecollectorcoredump_d_exe@exe/corecollector_coredump.d.o' -c ../source/corecollector/coredump.d
[16/57] ldc2 -I=source/41cf679@@test_libcorecollectorcoredump_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -J/home/rasmus/Projects/corecollector/source/corecollector/views -unittest -d-version=unittest_manual -of='source/41cf679@@test_libcorecollectorcoredump_d_exe@exe/corecollector_lib.d.o' -c ../source/corecollector/lib.d
[17/57] ldc2 -I=source/41cf679@@test_libcorecollectorconfiguration_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -J/home/rasmus/Projects/corecollector/source/corecollector/views -unittest -d-version=unittest_manual -of='source/41cf679@@test_libcorecollectorconfiguration_d_exe@exe/corecollector_configuration.d.o' -c ../source/corecollector/configuration.d
[18/57] ldc2 -I=source/41cf679@@test_libcorecollectorconfiguration_d_exe@exe -I=source -I=../source -enable-color -wi -g -d-debug -J/home/rasmus/Projects/corecollector/source/corecollector/views -unittest -d-version=unittest_manual -of='source/41cf679@@test_libcorecollectorconfiguration_d_exe@exe/corecollector_lib.d.o' -c ../source/corecollector/lib.d
[19/57] ldc2 -I=source/corehelper/167c82c@@corehelper-int-test-exe@exe -I=source/corehelper -I=../source/corehelper -I=source -I=../source -enable-color -wi -g -d-debug -d-version=unittest_manual -of='source/corehelper/167c82c@@corehelper-int-test-exe@exe/corehelper.d.o' -c ../source/corehelper/corehelper.d
[20/57] ldc2 -I=source/corehelper/167c82c@@corehelper-int-test-exe@exe -I=source/corehelper -I=../source/corehelper -I=source -I=../source -enable-color -wi -g -d-debug -d-version=unittest_manual -of='source/corehelper/167c82c@@corehelper-int-test-exe@exe/options.d.o' -c ../source/corehelper/options.d
[21/57] ldc2 -I=source/corehelper/167c82c@@corehelper-int-test-exe@exe -I=source/corehelper -I=../source/corehelper -I=source -I=../source -enable-color -wi -g -d-debug -d-version=unittest_manual -of='source/corehelper/167c82c@@corehelper-int-test-exe@exe/main.d.o' -c ../source/corehelper/main.d
[22/57] ldc2 -I=source/corehelper/167c82c@@corehelper@exe -I=source/corehelper -I=../source/corehelper -I=source -I=../source -enable-color -wi -g -d-debug -of='source/corehelper/167c82c@@corehelper@exe/corehelper.d.o' -c ../source/corehelper/corehelper.d
[23/57] ldc2 -I=source/corehelper/167c82c@@corehelper@exe -I=source/corehelper -I=../source/corehelper -I=source -I=../source -enable-color -wi -g -d-debug -of='source/corehelper/167c82c@@corehelper@exe/options.d.o' -c ../source/corehelper/options.d
[24/57] ldc2 -I=source/corehelper/167c82c@@corehelper@exe -I=source/corehelper -I=../source/corehelper -I=source -I=../source -enable-color -wi -g -d-debug -of='source/corehelper/167c82c@@corehelper@exe/main.d.o' -c ../source/corehelper/main.d
[25/57] ldc2 -I=source/corectl/a9795f2@@corectl-int-test-exe@exe -I=source/corectl -I=../source/corectl -I=source -I=../source -enable-color -wi -g -d-debug -d-version=unittest_manual -of='source/corectl/a9795f2@@corectl-int-test-exe@exe/corectl.d.o' -c ../source/corectl/corectl.d
[26/57] ldc2 -I=source/corectl/a9795f2@@corectl-int-test-exe@exe -I=source/corectl -I=../source/corectl -I=source -I=../source -enable-color -wi -g -d-debug -d-version=unittest_manual -of='source/corectl/a9795f2@@corectl-int-test-exe@exe/options.d.o' -c ../source/corectl/options.d
[27/57] ldc2 -I=source/corectl/a9795f2@@corectl-int-test-exe@exe -I=source/corectl -I=../source/corectl -I=source -I=../source -enable-color -wi -g -d-debug -d-version=unittest_manual -of='source/corectl/a9795f2@@corectl-int-test-exe@exe/main.d.o' -c ../source/corectl/main.d
[28/57] ldc2 -I=source/corectl/a9795f2@@corectl@exe -I=source/corectl -I=../source/corectl -I=source -I=../source -enable-color -wi -g -d-debug -of='source/corectl/a9795f2@@corectl@exe/corectl.d.o' -c ../source/corectl/corectl.d
[29/57] ldc2 -I=source/corectl/a9795f2@@corectl@exe -I=source/corectl -I=../source/corectl -I=source -I=../source -enable-color -wi -g -d-debug -of='source/corectl/a9795f2@@corectl@exe/options.d.o' -c ../source/corectl/options.d
[30/57] ldc2 -I=source/corectl/a9795f2@@corectl@exe -I=source/corectl -I=../source/corectl -I=source -I=../source -enable-color -wi -g -d-debug -of='source/corectl/a9795f2@@corectl@exe/main.d.o' -c ../source/corectl/main.d
[31/57] ldc2 -I=source/corecollector/6c1ca90@@core-lib-test-lib@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -J/home/rasmus/Projects/corecollector/source/corecollector/views -d-version=unittest_manual -of='source/corecollector/6c1ca90@@core-lib-test-lib@sha/meson-generated_.._globals.d.o' -c source/corecollector/globals.d
[32/57] ldc2 -I=source/corecollector/6c1ca90@@core-lib-test-lib@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -J/home/rasmus/Projects/corecollector/source/corecollector/views -d-version=unittest_manual -of='source/corecollector/6c1ca90@@core-lib-test-lib@sha/logging.d.o' -c ../source/corecollector/logging.d
[33/57] ldc2 -I=source/corecollector/6c1ca90@@core-lib-test-lib@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -J/home/rasmus/Projects/corecollector/source/corecollector/views -d-version=unittest_manual -of='source/corecollector/6c1ca90@@core-lib-test-lib@sha/coredump.d.o' -c ../source/corecollector/coredump.d
[34/57] ldc2 -I=source/corecollector/6c1ca90@@core-lib-test-lib@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -J/home/rasmus/Projects/corecollector/source/corecollector/views -d-version=unittest_manual -of='source/corecollector/6c1ca90@@core-lib-test-lib@sha/configuration.d.o' -c ../source/corecollector/configuration.d
[35/57] ldc2  -of=tests/crashing_test_exe 'tests/59830eb@@crashing_test_exe@exe/crash.d.o' -L=-L--allow-shlib-undefined
[36/57] ldc2 -I=source/corecollector/6c1ca90@@corecollector@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -of='source/corecollector/6c1ca90@@corecollector@sha/meson-generated_.._globals.d.o' -c source/corecollector/globals.d
[37/57] ldc2 -I=source/corecollector/6c1ca90@@corecollector@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -of='source/corecollector/6c1ca90@@corecollector@sha/logging.d.o' -c ../source/corecollector/logging.d
[38/57] ldc2 -I=source/corecollector/6c1ca90@@corecollector@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -of='source/corecollector/6c1ca90@@corecollector@sha/coredump.d.o' -c ../source/corecollector/coredump.d
[39/57] ldc2 -I=source/corecollector/6c1ca90@@corecollector@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -of='source/corecollector/6c1ca90@@corecollector@sha/configuration.d.o' -c ../source/corecollector/configuration.d
[40/57] ldc2 -I=source/corecollector/6c1ca90@@corecollector@sha -I=source/corecollector -I=../source/corecollector -I=source -I=../source -enable-color -wi -g -d-debug -relocation-model=pic -of='source/corecollector/6c1ca90@@corecollector@sha/muslsyslog.d.o' -c ../source/corecollector/muslsyslog.d
[41/57] rm -f tests/libcorecollector-lib-test.a && ar csrD tests/libcorecollector-lib-test.a 'tests/59830eb@@corecollector-lib-test@sta/libTest.d.o'
[42/57] ldc2  -of=tests/test-add-core 'tests/59830eb@@test-add-core@exe/testAddCore.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=tests/libcorecollector-lib-test.a -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/tests
[43/57] ldc2  -of=source/corecollector/libcore-lib-test-lib.so 'source/corecollector/6c1ca90@@core-lib-test-lib@sha/configuration.d.o' 'source/corecollector/6c1ca90@@core-lib-test-lib@sha/coredump.d.o' 'source/corecollector/6c1ca90@@core-lib-test-lib@sha/logging.d.o' 'source/corecollector/6c1ca90@@core-lib-test-lib@sha/meson-generated_.._globals.d.o' -L=--start-group -L=-L-soname,libcore-lib-test-lib.so -L=-L--allow-shlib-undefined -shared -relocation-model=pic -link-defaultlib-shared -L=--end-group
[44/57] /usr/bin/meson --internal symbolextractor source/corecollector/libcore-lib-test-lib.so 'source/corecollector/6c1ca90@@core-lib-test-lib@sha/libcore-lib-test-lib.so.symbols' 
[45/57] ldc2  -of=source/corecollector/libcorecollector.so.0.3.1 'source/corecollector/6c1ca90@@corecollector@sha/muslsyslog.d.o' 'source/corecollector/6c1ca90@@corecollector@sha/configuration.d.o' 'source/corecollector/6c1ca90@@corecollector@sha/coredump.d.o' 'source/corecollector/6c1ca90@@corecollector@sha/logging.d.o' 'source/corecollector/6c1ca90@@corecollector@sha/meson-generated_.._globals.d.o' -L=--start-group -L=-L-soname,libcorecollector.so.0 -L=-L--allow-shlib-undefined -shared -relocation-model=pic -shared -link-defaultlib-shared -L=--end-group
[46/57] /usr/bin/meson --internal symbolextractor source/corecollector/libcorecollector.so.0.3.1 'source/corecollector/6c1ca90@@corecollector@sha/libcorecollector.so.0.3.1.symbols' 
[47/57] ldc2  -of=source/test_corectloptions_d_exe 'source/41cf679@@test_corectloptions_d_exe@exe/corecollector_lib.d.o' 'source/41cf679@@test_corectloptions_d_exe@exe/corectl_options.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[48/57] ldc2  -of=source/test_corehelpercorehelper_d_exe 'source/41cf679@@test_corehelpercorehelper_d_exe@exe/corecollector_lib.d.o' 'source/41cf679@@test_corehelpercorehelper_d_exe@exe/corehelper_corehelper.d.o' 'source/41cf679@@test_corehelpercorehelper_d_exe@exe/corehelper_options.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[49/57] ldc2  -of=source/test_corehelperoptions_d_exe 'source/41cf679@@test_corehelperoptions_d_exe@exe/corecollector_lib.d.o' 'source/41cf679@@test_corehelperoptions_d_exe@exe/corehelper_options.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[50/57] ldc2  -of=source/test_libcorecollectorlogging_d_exe 'source/41cf679@@test_libcorecollectorlogging_d_exe@exe/corecollector_lib.d.o' 'source/41cf679@@test_libcorecollectorlogging_d_exe@exe/corecollector_logging.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[51/57] ldc2  -of=source/test_libcorecollectorconfiguration_d_exe 'source/41cf679@@test_libcorecollectorconfiguration_d_exe@exe/corecollector_lib.d.o' 'source/41cf679@@test_libcorecollectorconfiguration_d_exe@exe/corecollector_configuration.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[52/57] ldc2  -of=source/corehelper/corehelper-int-test-exe 'source/corehelper/167c82c@@corehelper-int-test-exe@exe/main.d.o' 'source/corehelper/167c82c@@corehelper-int-test-exe@exe/options.d.o' 'source/corehelper/167c82c@@corehelper-int-test-exe@exe/corehelper.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[53/57] ldc2  -of=source/corehelper/corehelper 'source/corehelper/167c82c@@corehelper@exe/main.d.o' 'source/corehelper/167c82c@@corehelper@exe/options.d.o' 'source/corehelper/167c82c@@corehelper@exe/corehelper.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcorecollector.so.0.3.1 -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[54/57] ldc2  -of=source/test_libcorecollectorcoredump_d_exe 'source/41cf679@@test_libcorecollectorcoredump_d_exe@exe/corecollector_lib.d.o' 'source/41cf679@@test_libcorecollectorcoredump_d_exe@exe/corecollector_coredump.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[55/57] ldc2  -of=source/corectl/corectl-int-test-exe 'source/corectl/a9795f2@@corectl-int-test-exe@exe/main.d.o' 'source/corectl/a9795f2@@corectl-int-test-exe@exe/options.d.o' 'source/corectl/a9795f2@@corectl-int-test-exe@exe/corectl.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[56/57] ldc2  -of=source/corectl/corectl 'source/corectl/a9795f2@@corectl@exe/main.d.o' 'source/corectl/a9795f2@@corectl@exe/options.d.o' 'source/corectl/a9795f2@@corectl@exe/corectl.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcorecollector.so.0.3.1 -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector
[57/57] ldc2  -of=source/test_corectlcorectl_d_exe 'source/41cf679@@test_corectlcorectl_d_exe@exe/corecollector_lib.d.o' 'source/41cf679@@test_corectlcorectl_d_exe@exe/corectl_corectl.d.o' -L=-L--allow-shlib-undefined -L=--start-group -L=source/corecollector/libcore-lib-test-lib.so -link-defaultlib-shared -L=--end-group -L=-rpath -L=/home/rasmus/Projects/corecollector/abuild/source/corecollector

@dcbaker
Copy link
Member

dcbaker commented Mar 10, 2020

You're right, that still isn't fixed.

dcbaker added a commit to dcbaker/meson that referenced this issue Mar 10, 2020
Some compilers that act as linker drivers (dmd and ldc) need to split
arguments that GCC combines with , (ie, -Wl,-foo,bar -> -L=-foo -L=bar).
As such we need to detect that the previous argument contained -soname,
and not wrap that in a --start-group/--end-group

Fixes mesonbuild#6359

	../../../tmplckitmb1.o
@dcbaker
Copy link
Member

dcbaker commented Mar 10, 2020

Okay, I think I have a fix. I've updated the PR. it turns out some things changed and resulted in the soname argument not getting applied correctly.

dcbaker added a commit to dcbaker/meson that referenced this issue Mar 10, 2020
Some compilers that act as linker drivers (dmd and ldc) need to split
arguments that GCC combines with , (ie, -Wl,-foo,bar -> -L=-foo -L=bar).
As such we need to detect that the previous argument contained -soname,
and not wrap that in a --start-group/--end-group

This modifies the shared library test to demonstrate the problem, with a
test case.

Fixes mesonbuild#6359
@Cogitri
Copy link
Contributor Author

Cogitri commented Mar 10, 2020

alright great, I'll test in a bit.

@Cogitri
Copy link
Contributor Author

Cogitri commented Mar 10, 2020

Seems like that fixed it, thank you! :)

dcbaker added a commit to dcbaker/meson that referenced this issue Mar 10, 2020
Some compilers that act as linker drivers (dmd and ldc) need to split
arguments that GCC combines with , (ie, -Wl,-foo,bar -> -L=-foo -L=bar).
As such we need to detect that the previous argument contained -soname,
and not wrap that in a --start-group/--end-group

This modifies the shared library test to demonstrate the problem, with a
test case.

Fixes mesonbuild#6359
Cogitri added a commit to Cogitri/corecollector that referenced this issue Mar 11, 2020
…eson versions

Meson >=0.52 and <0.54 contain a bug that causes bad linkage with ldc and dmd.
See mesonbuild/meson#6359 for more info.

fixes #24
dcbaker added a commit to dcbaker/meson that referenced this issue Mar 11, 2020
Some compilers that act as linker drivers (dmd and ldc) need to split
arguments that GCC combines with , (ie, -Wl,-foo,bar -> -L=-foo -L=bar).
As such we need to detect that the previous argument contained -soname,
and not wrap that in a --start-group/--end-group

This modifies the shared library test to demonstrate the problem, with a
test case.

Fixes mesonbuild#6359
Cogitri added a commit to Cogitri/corecollector that referenced this issue Mar 12, 2020
…ersions

Meson >=0.52 and <0.54 contain a bug that causes bad linkage with ldc and dmd.
See mesonbuild/meson#6359 for more info.

fixes #24
Cogitri added a commit to Cogitri/corecollector that referenced this issue Mar 12, 2020
…ersions

Meson >=0.52 and <0.54 contain a bug that causes bad linkage with ldc and dmd.
See mesonbuild/meson#6359 for more info.

fixes #24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants