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

Probably doing something wrong but I'm getting mixed 64 and 32 bit binaries on linux. #10

Open
hanetzer opened this issue Oct 6, 2023 · 2 comments

Comments

@hanetzer
Copy link

hanetzer commented Oct 6, 2023

So. The x370 chipset on ryzen is very much like asmedia stuff, and was hoping to poke it a bit in order to assist my port of coreboot to 'Asrock X370 Killer Sli/AC' (kind of in a working state; more to be done).

By issuing dotnet build I get a 64-bit ELF for AsmTool but the dlls come out as 32 bit. Attempting to run AsmTool
nets me the following error:

Unhandled exception. System.BadImageFormatException: Could not load file or assembly '~/ASMTool/AsmTool/bin/Debug/net6.0/AsmTool.dll'. An attempt was made to load a program with
an incorrect format.

File name: '~/ASMTool/AsmTool/bin/Debug/net6.0/AsmTool.dll'
Aborted (core dumped)

libAsmIOLinux.so is compiled and in the directory next to AsmTool (it is also a 64-bit ELF)

@rhn
Copy link

rhn commented Oct 16, 2023

I have the same issue. I used the CI dockerfile and commands, but the created artifact is unuseable.

@voltagex
Copy link

In the CMake files, there's a line that clears the target platform but it doesn't get set again on Linux.

Theoretically

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4da64d4..1787fce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,7 @@ ADD_DOTNET(${CMAKE_SOURCE_DIR}/AsmTool.sln
 )

 if(UNIX)
+       set(target_platform PLATFORM x64)
        enable_language(C)
        add_subdirectory(AsmTool/Linux)
        add_dependencies(AsmTool_sln asmIoLinux)

should be enough to fix it, but

voltagex@BeeMovie:~/src/ASMTool/build/out$ file libasmIoLinux.so
libasmIoLinux.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=16e6d63384efb4239eb312f502242296346eae03, not stripped
voltagex@BeeMovie:~/src/ASMTool/build/out$ file AsmTool
AsmTool: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=10540531054f88680224e7bf543dc2dbef55c014, for GNU/Linux 2.6.32, stripped
voltagex@BeeMovie:~/src/ASMTool/build/out$ file AsmTool.dll
AsmTool.dll: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows, 3 sections

@smx any idea what's going on here?

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

3 participants