-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Need help with external dependency for einat #16
Comments
Saw your post openwrt/packages#24375 from your profile, it's the
This is less on einat as we don't build The error pops up because
I am not sure why your For passing library search path to rustc then to ld, you can use environment variable
I am not familiar with OpenWrt build system, maybe @muink can give some insight. |
Any others OpenWrt package that are using libelf seems to be unaffected.
Any attempt to make OpenWrt rustc toolchain to notice rpath or rpath-link seems failed in my tries. Seems like rustc just ignore whatever my variables throw at it.
If I am doing at shell not OpenWrt build system :
before ldd then it can found libintl.so.8 but compilation still failing. Your proposes workaround also weirdly not picked up by rustc, still the same error.
|
I'm not familiar with rust build system. The following code reveals the binary build process of a rust application in openwrt and may provide some reference. |
I mean the build system specifically, as
It's about As a workaround, try adding a rapth to
This should be path to parent directory of the library, not path to the library itself. Also you should fill path to parent directory of As you are doing this externally, it could be that OpenWrt build system overrides I have noticed it's the build script of einat failed to link with However in build process |
In OpenWrt we use somekind of OpenWrt package Makefile to make to package compilation going on, in comparison with other package, I don't see anything differences on muink's einat OpenWrt package Makefile with other rust app that are compiled on OpenWrt. Probably this is between OpenWrt inner build process or bugs in rustc itself?.
I think the libelf that are used are the one from OpenWrt :
It's a typo, sorry.
I have tried to override LD_LIBRARY_PATH from OpenWrt also getting ignored.
Both of libelf-dev and zlib1g-dev are already installed. |
Already checked that out and tried some tinkering on it but still no progress. So you don't enabled CONFIG_BUILD_NLS ?. |
I have pushed 3174aca to branch pre-gen-skel, this commit drops libelf and zlib requirements on build platform(the host platform still needs them). Try building openwrt-einat-ebpf with this branch. If this works for you, than presumably it's a problem on setup of build platform dependencies in OpenWrt's Rust build process. As the build script of einat is supposed to link against libelf on build platform. |
Since the compilation machine is not at hand at the moment I will test it at a later time.
Building Normally
They are built by the host tool |
Thank you for libelf workaround but still the same errors, although it now took quite more longer than before to compiling and reach that error. |
Ok, then it seems like the problem is on target libelf. The ld for build script yells because the build platform and the host platform has the same architecture x86-64 so it looks for broken libelf for host platform by some order. Also seems @muink's build of openwrt-einat-ebpf uses musl instead of glibc, not sure if this is related or not. PS: I am describing build platform and host platform from perspective of target machine. They may also be called as host and target respectively from perspective of build machine. |
I have patchelf the libelf itself, now ldd result (even without setting LD_LIBRARY_PATH):
But compilation still failing. Yes I am using glibc targeting x86_64. rustc seems to ignore we everything throw at it, I really wonder why. I am sure it's as simple as rustc is accepting rpath or rpath-link. |
What is the log after your added rpath to libelf? Did you use branch pre-gen-skel or not? Also try using "-C link-args" on |
The same build failed
|
Sorry, looking at wrong person. |
The same errors log, I think identical, now trying to pass very verbose to cargo. Yes I am using pre-gen-skel
like these ? :
@muink |
Yes, maybe you can also try append edit: |
In where do i need to append it?, can you give an example?. cargo very verbose (-vv) log :
@muink |
It's a linker flag, this is same as how you supply the Seems you don't understand basics on how linkage works.. |
I quite understand the basic but not in-depth, imho isn't it we passing -W1 to gcc with CFLAGS? . Isn't it in rustc with RUSTFLAGS env variable? [EDIT] |
I tried appending |
It's like rustc just ignoring it?, that's probably what I've found also. |
For your case, it's not rustc ignoring the Please stop being misleading for implying it's the rustc causes the problem. The issue here is that indirectly referenced library I believe if we can pass
However the runtime exection of einat or it's build script binary is not guaranteed as (2) For @vortexilation 's case, the build script is linking with potentially broken libelf from host platform instead of libelf from build platform. So if not using (3) What need to be resolved first here is why neither (1) (2) (3) are separate issues that need to be resolved. |
muink/openwrt-einat-ebpf@fdfb646 The |
|
Managed to somehow passing into LD but not parse-able by LD/gcc itself ? :
|
This comment was marked as resolved.
This comment was marked as resolved.
@predators46 Your log and your answer was not helpful. This is not a support forum. Go read and try follow https://github.com/muink/openwrt-einat-ebpf 's README first. And if that not works even after that, file a separate issue in a proper place with your problem described in detail instead of letting someone else guessing it for you. @predators46 has deleted their comments, here's the recreated conversation:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Closing as this is becoming lengthy and off-topic. And this is not really a issue in the scope of einat development. It's also spreading the information which would not be reachable by others by default. Please continue the conversation in issues opened by @vortexilation in OpenWrt's repos. And feel free to tag me there. |
Describe the bug
I have got problem compiling einat for OpenWrt x86_64 glibc using the muink's einat OpenWrt Package .
At the end of the compilation I am getting rustc cannot find libintl.so.8 :
the libintl.so.8 is located in :
I am not a rust developer by any means but after doing some research, I have modified the build.rs / build script as the following :
But doesn't get any differences.
Expected behavior
Able to compile einat for OpenWrt x86_64 with CONFIG_BUILD_NLS enabled.
Target Machine (please complete the following information):
The text was updated successfully, but these errors were encountered: