www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Meson issue with -L--export-dynamic flag

reply Gerald <gerald.b.nunn gmail.com> writes:
Myself and some others are looking at replacing autotools in 
Tilix with meson for the various Linux distros to use when 
building and packaging the binary. However we are running into an 
issue with meson around the use of the "-L--export-dynamic" flag.

When compiling with meson using LDC and that flag the following 
errors are generated:

[66/66] Linking target tilix.
FAILED: tilix
ldc  -of tilix 'tilix exe/source_secretc_secrettypes.d.o' 
'tilix exe/source_secretc_secret.d.o' 'tilix exe/source_app.d.o' 
'tilix exe/source_x11_X.d.o' 'tilix exe/source_x11_Xlib.d.o' 
'tilix exe/source_secret_SchemaAttribute.d.o' 
'tilix exe/source_secret_Item.d.o' 
'tilix exe/source_secret_Schema.d.o' 
'tilix exe/source_secret_Service.d.o' 
'tilix exe/source_secret_Prompt.d.o' 
'tilix exe/source_secret_Collection.d.o' 
'tilix exe/source_secret_Secret.d.o' 
'tilix exe/source_secret_Value.d.o' 
'tilix exe/source_gx_util_array.d.o' 
'tilix exe/source_gx_util_path.d.o' 
'tilix exe/source_gx_util_string.d.o' 
'tilix exe/source_gx_gtk_cairo.d.o' 
'tilix exe/source_gx_gtk_clipboard.d.o' 
'tilix exe/source_gx_gtk_x11.d.o' 
'tilix exe/source_gx_gtk_resource.d.o' 
'tilix exe/source_gx_gtk_vte.d.o' 
'tilix exe/source_gx_gtk_actions.d.o' 
'tilix exe/source_gx_gtk_threads.d.o' 
'tilix exe/source_gx_gtk_dialog.d.o' 
'tilix exe/source_gx_gtk_settings.d.o' 
'tilix exe/source_gx_gtk_util.d.o' 
'tilix exe/source_gx_gtk_color.d.o' 
'tilix exe/source_gx_tilix_appwindow.d.o' 
'tilix exe/source_gx_tilix_terminal_advpaste.d.o' 
'tilix exe/source_gx_tilix_terminal_search.d.o' 
'tilix exe/source_gx_tilix_terminal_regex.d.o' 
'tilix exe/source_gx_tilix_terminal_actions.d.o' 
'tilix exe/source_gx_tilix_terminal_activeprocess.d.o' 
'tilix exe/source_gx_tilix_terminal_terminal.d.o' 
'tilix exe/source_gx_tilix_terminal_layout.d.o' 
'tilix exe/source_gx_tilix_terminal_password.d.o' 
'tilix exe/source_gx_tilix_terminal_util.d.o' 
'tilix exe/source_gx_tilix_terminal_exvte.d.o' 
'tilix exe/source_gx_tilix_terminal_monitor.d.o' 
'tilix exe/source_gx_tilix_sidebar.d.o' 
'tilix exe/source_gx_tilix_customtitle.d.o' 
'tilix exe/source_gx_tilix_prefeditor_bookmarkeditor.d.o' 
'tilix exe/source_gx_tilix_prefeditor_profileeditor.d.o' 
'tilix exe/source_gx_tilix_prefeditor_common.d.o' 
'tilix exe/source_gx_tilix_prefeditor_prefdialog.d.o' 
'tilix exe/source_gx_tilix_prefeditor_titleeditor.d.o' 
'tilix exe/source_gx_tilix_prefeditor_advdialog.d.o' 
'tilix exe/source_gx_tilix_preferences.d.o' 
'tilix exe/source_gx_tilix_application.d.o' 
'tilix exe/source_gx_tilix_shortcuts.d.o' 
'tilix exe/source_gx_tilix_colorschemes.d.o' 
'tilix exe/source_gx_tilix_session.d.o' 
'tilix exe/source_gx_tilix_constants.d.o' 
'tilix exe/source_gx_tilix_common.d.o' 
'tilix exe/source_gx_tilix_cmdparams.d.o' 
'tilix exe/source_gx_tilix_encoding.d.o' 
'tilix exe/source_gx_tilix_closedialog.d.o' 
'tilix exe/source_gx_tilix_bookmark_manager.d.o' 
'tilix exe/source_gx_tilix_bookmark_bmchooser.d.o' 
'tilix exe/source_gx_tilix_bookmark_bmeditor.d.o' 
'tilix exe/source_gx_tilix_bookmark_bmtreeview.d.o' 
'tilix exe/source_gx_i18n_l10n.d.o' -L-L/usr/lib// -L-lgtkd-3 
-L-ldl -L-lvted-3 -L-L/usr/lib// -L-lgtkd-3 -L-ldl -L-lX11
/usr/bin/ld: tilix exe/source_gx_tilix_appwindow.d.o: in function 
`_D2gx5tilix6common__T12GenericEventTCQBjQBj7session7SessionZQBn11__xopEqualsFKxSQDaQDaQCx__TQCtTQCiZQDbKxQBaZb':
/tmp/tilix/build/../source/gx/tilix/common.d:28: undefined 
reference to 
`_D6object__T8__equalsTxDFC2gx5tilix7session7SessionZvTxQBgZQBvFNaNbNiNfAxQByQfZb'
/usr/bin/ld: tilix exe/source_gx_tilix_terminal_terminal.d.o: in 
function 
`_D2gx5tilix6common__T12GenericEventTEQBjQBjQBg10ActionTypeTCQCgQCgQCd__T16CumulativeResultTbZQvZQCx11__xopEqualsFKxSQEkQEkQEh__TQEdTQDsTQCzZQEpKxQBeZb':
/tmp/tilix/build/../source/gx/tilix/common.d:28: undefined 
reference to 
`_D6object__T8__equalsTxDFE2gx5tilix6common10ActionTypeCQBdQBdQBa__T16CumulativeResultTbZQvZvTxQCtZQDiFNaNbNiNfAxQDlQfZb'
/usr/bin/ld: tilix exe/source_gx_tilix_terminal_terminal.d.o: in 
function 
`_D2gx5tilix6common__T12GenericEventTAyaTQeTQhTQkZQBc11__xopEqualsFKxSQCpQCpQCm__TQCiTQBxTQCbTQCfTQCjZQDcKxQBmZb':
/tmp/tilix/build/../source/gx/tilix/common.d:28: undefined 
reference to 
`_D6object__T8__equalsTxDFAyaQdQfQhZvTxQpZQBdFNaNbNiNfAxQBgQfZb'
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1
ninja: build stopped: subcommand failed.


Taking out the export-dynamic flag it all works fine. 
Unfortunately this flag is the default for the DMD compiler 
(which apparently exhibits the same behavior) as well as LDC on 
some distros like Arch. That flag looks pretty innocuous so I'm 
not sure why it is causing an issue.

I could use some help from someone more experienced with the 
compiler to help understand what is going on and if there is an 
issue with tilix, meson or the compiler itself. A full discussion 
of the issue can be viewed here:

https://github.com/gnunn1/tilix/issues/1502
Sep 03 2018
next sibling parent Gerald <gerald.b.nunn gmail.com> writes:
For anyone that wants to try to reproduce it, you can clone this 
repo and switch to the meson branch:

https://github.com/bilelmoussaoui/tilix
Sep 03 2018
prev sibling parent Russel Winder <russel winder.org.uk> writes:
On Mon, 2018-09-03 at 13:19 +0000, Gerald via Digitalmars-d-learn
wrote:
 Myself and some others are looking at replacing autotools in=20
 Tilix with meson for the various Linux distros to use when=20
 building and packaging the binary. However we are running into an=20
 issue with meson around the use of the "-L--export-dynamic" flag.
=20
I have been using -L-Wl,--export-dynamic to get C symbols exported at runtime with ldc2, I am nt sure if this datum helps any. =20 --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Sep 06 2018