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

Fix building #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix building #2

wants to merge 2 commits into from

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