-
Notifications
You must be signed in to change notification settings - Fork 16
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
Cannot build on Ubuntu 20 with instructions on repository. #19
Comments
Thanks for reporting. Did you try these instructions? |
These are the exact instructions I tried. It appears to be the same issue as #15 , where the i386 libraries cannot be found and it's trying to look in x86-64 for them. I could probably try this in a 32-bit machine instead and see how that goes, but I'm experimenting to see if I can get it to compile either way. Update: libsdl1.2-compat-dev:i386 appears to be the only missing package, and that can't be installed directly via sudo apt install libsdl1.2-compat-dev:i386 - will have to look into that. |
I've found a way to get it to fully compile without errors on my current fork but it requires a pretty hacky method of manually downloading the dependencies and turning off a few things in the makefile. https://github.com/TrashRaccoonSnuffy/zsnes/commit/774afa286483d4cba56118cf0404a4cfa0f0c55b
Running the program leads to this though: So I'm probably missing something else now, or running the incorrect tools. |
Thanks for adding more information! Some problems may (possibly, maybe) be with SDL1, but be solved by using sdl2-compat. Also, the early parts of the Makefile seems to require a 64-bit enviroment, while the rest seems to require a 32-bit environment, which is odd and on my TODO list in the back of my head for things I want to fix. This seems to be a Debian/Ubuntu specific issue, though. I will give it a go on Ubuntu 20 as well. |
This crash occurs in clearvidsound() in initc.c , specifically at memset(&echoon0, 0, PHdspsave2); Possibly related to #5 There is a patch here https://github.com/rpmfusion/zsnes/blob/master/zsnes-1.51-FORTIFY_SOURCE.patch that I will try and I will report back if it does anything.
|
Games do not boot at all and lead to a buffer overflow error however. More patches will have to be applied to get it fully working. There also needs to be an easier way to set up the packages for i386, since atleast on ubuntu attempting to install libc i386 wants to delete the x86_64 version and that can't be worked with. Update: Turning off _FORTIY_SOURCE seems to fix the issues, but that probably isn't the safest thing to do. |
Thanks for the additional info and for your contributions. I'll test and patch this when I can. (It's been a busy week). 🙂 |
Thanks. I've decided to make a separate branch to put all the changes necessary to compile on Ubuntu. It's already working with 5265da3 and the other step I described above with manually downloading the i386 packages and putting their usr folder in the root. I already put a fix on the main repository for one of the buffer overflow issues, but on Ubuntu it's necessary to disable FORTIFY_SOURCE to get it to fully work otherwise the emulator will crash when loading a new game after one is already loaded. This is probably due to a GCC bug. |
I am running a 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (lscpu says it's x86_64), and running make seems to give the following results:
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.a when searching for -lz /usr/bin/ld: cannot find -lz: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.so when searching for -lX11 /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.a when searching for -lX11 /usr/bin/ld: cannot find -lX11: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.so when searching for -lX11 /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libSDL.so when searching for -lSDL /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libSDL.a when searching for -lSDL /usr/bin/ld: cannot find -lSDL: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libSDL.so when searching for -lSDL /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpng16.so when searching for -lpng16 /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpng16.a when searching for -lpng16 /usr/bin/ld: cannot find -lpng16: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpng16.so when searching for -lpng16 /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.a when searching for -lz /usr/bin/ld: cannot find -lz: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libGL.so when searching for -lGL /usr/bin/ld: cannot find -lGL: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libGL.so when searching for -lGL
I saw issue #15 and I thought it might have been related, are the libraries necessary still i386?
I actually managed to get way further in compilation by removing -m32 from the cflags, the
ifeq ($(wildcard /usr/lib/i386-linux-gnu/.),)
line in the Makefile and changing the flags inside to
CFLAGS += -I/usr/include/x86_64-linux-gnu -I /usr/include/X11 CXXFLAGS += -I/usr/include/x86_64-linux-gnu -I /usr/include/X11 LDFLAGS = -Wl,--as-needed -no-pie -Wl,--gc-sections -lz -lSDL-1.2 -lpng16 -lX11
and now the errors are only
/usr/bin/ld: cannot find -lSDL-1.2: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib32/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib32/libm.a when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib32/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib32/libm.a when searching for -lm
The libm issue seems pretty easy to fix, but I'm not sure about lsdl2 or if removing -m32 is safe at all.
The text was updated successfully, but these errors were encountered: