Skip to content

Conversation

@dpino
Copy link

@dpino dpino commented Jun 9, 2017

I was unable to run the Makefile as it is now in master. For instance, the path to dynasm in Makefile misses third_party/ route:

$ make
lua dynasm/dynasm.lua jit2.dasc > jit2.h
lua: cannot open dynasm/dynasm.lua: No such file or directory
Makefile:11: recipe for target 'jit2.h' failed
make: *** [jit2.h] Error 1

After fixing that, I got the following error:

$ make
cc -O3 -g -std=gnu99 -Ithird_party  -o jit2 dynasm-driver.c -DJIT=\"jit2.h\"
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:9: recipe for target 'jit2' failed
make: *** [jit2] Error 1

The problem is that *.dasc files are compiled to .h, but they contain the main function. To fix that I turned
dynasm-driver.c into a header and compile the *.dasc files to *.c

After those changes, the Makefile can build the executables now:

$ make
cc -O3 -g -std=gnu99 -Ithird_party -D DASM_VERSION=10300    jit1.c   -o jit1
cc -O3 -g -std=gnu99 -Ithird_party -D DASM_VERSION=10300  dynasm-driver.h jit2.c -o jit2
cc -O3 -g -std=gnu99 -Ithird_party -D DASM_VERSION=10300  dynasm-driver.h jit3.c -o jit3

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

Successfully merging this pull request may close these issues.

1 participant