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

Unable to compile on DOS #119

Closed
leap0x7b opened this issue Sep 1, 2021 · 1 comment
Closed

Unable to compile on DOS #119

leap0x7b opened this issue Sep 1, 2021 · 1 comment

Comments

@leap0x7b
Copy link

leap0x7b commented Sep 1, 2021

WARNING: Please, read this note carefully before submitting a new bug:

It is important to realize that this is NOT A SUPPORT FORUM, this is for reproducible BUGS ONLY.

If you need support, have questions, ideas to discuss you should use
the Nelua Discussions forum or
the Nelua Discord server.

Please, before submitting a new issue, verify the following:

  • You have tested it on latest Nelua version from master branch.
  • You have checked that there is no similar issue already reported.
  • You have checked that your code has no errors or misuse of Nelua.

Bug description

A clear and concise description of the bug you are experiencing.
Tell what you were trying to do and what happened instead.

I'm trying to build Nelua on DOSBox-X using DJGPP, but it failed to compile.
Screenshot_20210831-215453

Expected behavior

A clear and concise description of what you expected to happen.

It should compile correctly

Environment

Provide relevant information about your environment:

  • Nelua version (you can check with nelua -v). Nelua from the master branch
  • Platform (e.g. Windows/MSYS2, Ubuntu Linux, MacOS) DOSBox-X
  • Architecture (e.g. x86_64, arm64) i386 (DOSBox-X)
  • C compiler if your bug has C compiler errors. (e.g. GCC 10.2, Clang 11) GCC 9.3.0
@leap0x7b leap0x7b added the bug label Sep 1, 2021
@edubart
Copy link
Owner

edubart commented Sep 1, 2021

I've fixed those issues and others in commit 41bf260, but then lots of issues starts to appear, it's not worth to get Nelua compiler to work inside DOSBox, it's best to use it outside with DJGPP installed in your host OS, there are some binary releases for it at https://github.com/andrewwutw/build-djgpp/releases .

Then once you get DJGPP installed in your system, you should compile with the following line:

nelua --cc=i686-pc-msdosdjgpp-gcc --cflags="-march=i386 -lemu" -bo hello.exe examples/helloworld.nelua

Then copy hello.exe to DOSBox files and it show work.

In case you insist trying to compile nelua-lua.exe to use inside DOSBox, I was able to compile with the following line:

make SYS=Posix \
           CC=i686-pc-msdosdjgpp-gcc \
           NO_RPMALLOC=1 \
           CFLAGS="-march=i386 -lemu -D_longjmp=longjmp -D_setjmp=setjmp -Dgetc_unlocked=getc -Dflockfile=UNUSED -Dfunlockfile=UNUSED -DLUA_CPATH_DEFAULT='\"\"' -DLUA_DIRSEP='\"\\\\\"' -DLUA_PATH_DEFAULT='\".\\\\?.lua\"'"

This generates a working nelua-lua.exe that can run Lua scripts, but it's failing finding modules files, and I am not going to or think it's worth to patch the Lua interpreter, so I've stopped there.

@edubart edubart closed this as completed Sep 1, 2021
@edubart edubart added the wontfix label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants