merlin icon indicating copy to clipboard operation
merlin copied to clipboard

make agent-dll fails

Open ghost opened this issue 7 years ago • 1 comments

Prerequisite

  • [x] I have read the README
  • [x] I have search the opened & closed issues
  • [x] I have search the WIKI and its FAQ page

Environment Data

  • Merlin Version: tip (v0.6.4.BETA)
  • Merlin Build: tip
  • Go Version: go version go1.11.4 darwin/amd64
  • GOPATH Environment Variable: /Users/apple/workspace/go
  • GOROOT Environment Variable: /usr/local/opt/go/libexec
  • Operating System: darwin

Expected Behavior

when i run make agent-dll i expected to get a .ddl in the output directory, but did not. Compiling to pure golang binaries for all OS's works btw

Actual Behavior

cd /Users/apple/workspace/go/src/github.com/Ne0nd0g/merlin && make agent-dll
export GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_ENABLED=1; \
        go build -buildmode=c-archive -o data/temp/v0.6.4.BETA/eb92bab9980f5b5d728b8a7bf15e894554ff0206/main.a cmd/merlinagentdll/main.go; \
        cp data/bin/dll/merlin.c data/temp/v0.6.4.BETA/eb92bab9980f5b5d728b8a7bf15e894554ff0206; \
        x86_64-w64-mingw32-gcc -shared -pthread -o data/temp/v0.6.4.BETA/eb92bab9980f5b5d728b8a7bf15e894554ff0206/merlin.dll data/temp/v0.6.4.BETA/eb92bab9980f5b5d728b8a7bf15e894554ff0206/merlin.c data/temp/v0.6.4.BETA/eb92bab9980f5b5d728b8a7bf15e894554ff0206/main.a -lwinmm -lntdll -lws2_32
/usr/local/Cellar/mingw-w64/5.0.4_1/toolchain-x86_64/bin/x86_64-w64-mingw32-ld: /var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T//cc4ILowZ.o:merlin.c:(.text+0xe): undefined reference to `Run'
collect2: error: ld returned 1 exit status
make[1]: *** [agent-dll] Error 1
make: *** [build-dll] Error 2

Steps to Reproduce Behavior

Run make agent-dll

Misc Information


x-MacBook-Pro:eb92bab9980f5b5d728b8a7bf15e894554ff0206 apple$ pwd
/Users/apple/workspace/go/src/github.com/Ne0nd0g/merlin/data/temp/v0.6.4.BETA/eb92bab9980f5b5d728b8a7bf15e894554ff0206

x-MacBook-Pro:eb92bab9980f5b5d728b8a7bf15e894554ff0206 apple$ ls -al
total 126872
drwxr-xr-x  11 apple  staff       352 Jan  4 13:16 .
drwxr-xr-x   3 apple  staff        96 Jan  4 13:13 ..
-rw-r--r--   1 apple  staff  17586928 Jan  4 13:16 main.a
-rw-r--r--   1 apple  staff      2702 Jan  4 13:16 main.h
-rw-r--r--   1 apple  staff        77 Jan  4 13:16 merlin.c
-rwxr-xr-x   1 apple  staff   8089924 Jan  4 13:13 merlinAgent-Darwin-x64
-rwxr-xr-x   1 apple  staff   7364608 Jan  4 13:13 merlinAgent-Linux-x64
-rwxr-xr-x   1 apple  staff   7434240 Jan  4 13:13 merlinAgent-Windows-x64.exe
-rwxr-xr-x   1 apple  staff   8664852 Jan  4 13:13 merlinServer-Darwin-x64
-rwxr-xr-x   1 apple  staff   7898720 Jan  4 13:13 merlinServer-Linux-x64
-rwxr-xr-x   1 apple  staff   7900672 Jan  4 13:13 merlinServer-Windows-x64.exe

ghost avatar Jan 04 '19 12:01 ghost

This issue appears to be unique to macOS and is likely a complexity of MinGW and not a bug in Merlin. I was able to duplicate the issue. However, the DLL compiles fine on Windows and Linux. This will take some additional research.

Ne0nd0g avatar Jan 10 '19 16:01 Ne0nd0g

I'm closing this issue after almost 4 years of inactivity. If the problem persist with the latest commits and the latest version of Go, please re-open.

Ne0nd0g avatar Nov 09 '23 13:11 Ne0nd0g