-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Package request: elf toolchain #5859
Comments
This is dependent from BSD make (bmake) |
Tools from this toolchain required for build dynamorio project https://github.com/DynamoRIO/dynamorio/ |
bmake package ported now. So it can be done, I think. |
Current state:
|
Those headers are *nix specific. So may need some porting exercise. Some queries:
|
Yes, this package needed to port DynamoRio and Dr.Memory to MinGW toolchain. |
So I really need libelftc and libdwarf from it. |
I create draft of Windows branch: https://github.com/ofry/elftoolchain/tree/windows-mingw-port But still no luck:
Any ideas? |
Did you search the other builds? Doing so shows that the MSVC patch references those symbols: https://github.com/DynamoRIO/dynamorio/blob/master/ext/drsyms/libelftc-pecoff/libelftc-pecoff.patch#L377 |
@derekbruening Sorry for another dumb question. Current state:
Any ideas? |
I put sys/queue.h from Cygwin project and got rid of macro STAILQ_LAST. So I got:
|
This might be a silly question, but... why is the ELF toolchain required on Windows, if windows executables or DLLs do not have an ELF format? It feels to me that you are trying to build DynamoRIO as a "Linux tool" inside MINGW, which is NOT correct. Inside MINGW, you generate Windows binaries/libs. The last reference to Cygwin implies that you might be going the MSYS way. Still, I think it might not work. So, I think that the main question is: what type of executables do you want your DynamoRIO build to analyze? If you want to analyze ELF binaries on Windows, I strongly suggest to try Docker or WSL, instead of MSYS2. For example, some of the images in dbhi/docker include DynamoRIO on Ubuntu Bionic containers. |
It's not about the ELF part of libelftc: that is not needed on Windows. What is needed is the libdwarf (DWARF parsing) and libelftc (C++ demangling) components of libelftc. MINGW and Cygwin binaries typically have DWARF debug information, not PDB-format debug info. |
Related PR to fix this: #6719 |
@derekbruening Are you know how to fix this and what's problem?
|
Looks like it's not linked with mingw-w64 CRT. |
@mati865 Could you give me correct option to link it in |
@ofry the correct way of doing it is calling |
If hardcoding it is bad idea, how to handle it right? |
@ofry by calling the compiler as the linker. |
@mati865 Could you give me an example based on bash commands in my task? |
@ofry this should work assuming the build system sets
|
As already stated, there is no need to build libelf. Only libdwarf and libelftc. (Maybe those 2 have similar errors: but the lines you're pasting are for libelf). |
After merge #6768, current state:
|
After some fixes, I still got this error:
@derekbruening @mati865 Any thoughts? |
That's still libelf? Please see my earlier comment about not building libelf: #5859 (comment) |
@derekbruening But I think same problem will be with other libraries too. |
#6779 should fix this bug, though. |
After merging #6779 libelf compiles fine, but libdwarf got errors in link stage.
@derekbruening @mati865 Any thoughts? |
Those missing symbols are provided by |
You do not want to include any ELF files, nor link with libelf. Remove libdwarf_elf_access.c and libdwarf_elf_init.c from the build. That is what the PECOFF build of libelftc is already doing, as you can see in the checked-in patch inside DR. |
I see that this issue's title is "elf toolchain", but if the goal is to build what DR needs, that's a BSD-licensed libdwarf plus a demangling library, not an elf toolchain. |
@mati865 It should be fixed with #6802 @derekbruening I have second goal: catch and fix some bugs in core build rules set which makes bmake unusable even with working bmake.exe |
Not sure what you mean: DR's "core/" directory uses CMake, which can generate Makefiles (along with other build system files). If those don't work with bmake: that would be a CMake issue, not a DR issue. If you mean the libelftc build rules, that would involve that project, not DR. |
Now all libraries builds fine through bmake. I'll close this issue for favor to DynamoRIO/dynamorio#4422 |
Project URL: https://sourceforge.net/projects/elftoolchain/
The text was updated successfully, but these errors were encountered: