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

System LLVM library conflicts #91

Open
pjaaskel opened this issue Jul 11, 2019 · 4 comments
Open

System LLVM library conflicts #91

pjaaskel opened this issue Jul 11, 2019 · 4 comments

Comments

@pjaaskel
Copy link
Contributor

pjaaskel commented Jul 11, 2019

Linkage fails with Ubuntu 18.04 LTS when running the tools from build directories and having the updates repository enabled:

relocation error: /home/visit0r/src/tce/tce/src/.libs/libtce.so.20: symbol _ZN4llvm23EnableABIBreakingChecksE version LLVM_8 not defined in file libLLVM-8.so with link time reference

This is because Ubuntu 18.04 generates an illegal libtool wrapper script which overrides the user set LD_LIBRARY_PATH by prepending the system library path, thus loading the libLLVM8.so required by libqt, (indirectly) by libwxgtk etc. while the user would like to use the TCE-patched one installed in the home directory.

A workaround is to force load the custom libLLVM via LD_PRELOAD. This is of course nice since it induces the libLLVM-8.so load time to all ld.so invocations (basically all commands). But it's needed only when running the tools from the build dir.

E.g.

export LD_PRELOAD=$HOME/local/lib/libLLVM-8.so

Another workaround would be to make TCE use libLLVM-8.0.1.so or similar since Ubuntu 18.04 does not ship that (yet), thus we'd link to the TCE patched one.

The true issue here is the libtoolize bug that overrides user LD_LIBRARY_PATH, hopefully it will be fixed in the future. We should report it if it's not (TODO).

@pjaaskel pjaaskel changed the title KUbuntu 18.04 LTS and LLVM 8 issue Ubuntu 18.04 LTS and LLVM 8 issue Jul 11, 2019
@pjaaskel
Copy link
Contributor Author

@pjaaskel
Copy link
Contributor Author

pjaaskel commented Nov 1, 2020

This is an annoying issue as it also makes an installed libtce.so found even when running from the build tree.

@pjaaskel pjaaskel reopened this Nov 1, 2020
@pjaaskel
Copy link
Contributor Author

pjaaskel commented Nov 1, 2020

Yep this fix breaks build tree execution. A better fix should be found.

@pjaaskel pjaaskel changed the title Ubuntu 18.04 LTS and LLVM 8 issue System LLVM library conflicts Nov 2, 2020
@pjaaskel pjaaskel added this to the 1.22 milestone Nov 2, 2020
pjaaskel added a commit that referenced this issue Nov 3, 2020
The current fix to #91 breaks
build dir execution when one has an installed libtce.so. This
is because it makes LD_LIBRARY_PATH the preference (which could
point to a custom library location with a libtce.so) instead
of the build dir one, like the libtool wrapper is expected
to do.
pjaaskel added a commit that referenced this issue Nov 3, 2020
This will be used starting from LLVM 11 to avoid the usual
annoying conflicts with system/other LLVM, that seem to be
hard to avoid with the broken libtool (see Issue #91).
@pjaaskel
Copy link
Contributor Author

This problem is still unsolved. I forgot about it and got interesting problems as I had an libopenasip.so installed which linked to LLVM-14 and it got loaded first by the unit tests as I had that library's path in my LD_LIBRARY_PATH.

@pjaaskel pjaaskel reopened this Nov 15, 2022
pjaaskel added a commit that referenced this issue Nov 15, 2022
Ignore a couple of harmless warnings from CXXTEST harness.

Yet another workaround for #91:
ensure the build-tree libopenasip.so is first in LD_LIBRARY_PATH when
running unit tests through compiletest.sh.
@pjaaskel pjaaskel removed this from the 1.22 milestone Nov 16, 2022
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