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

Probably won't compile with GCC 10 on Linux (-fcommon issue) #14

Open
vain opened this issue Sep 15, 2020 · 7 comments
Open

Probably won't compile with GCC 10 on Linux (-fcommon issue) #14

vain opened this issue Sep 15, 2020 · 7 comments

Comments

@vain
Copy link

vain commented Sep 15, 2020

GCC 10 changed the default from -fcommon to -fno-common:

https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common

I haven't tested this with your version of Mosaic, only with another fork (https://github.com/yotann/ncsa-mosaic -- because it has been ported to a newer version of libpng, see #8). IMO, it's more than likely that it affects your version as well (I don't see any relevant differences between the two) and wanted to let you know.

One blunt workaround is to add -fcommon:

diff --git a/makefiles/Makefile.linux b/makefiles/Makefile.linux
index 2cea009..ad03902 100755
--- a/makefiles/Makefile.linux
+++ b/makefiles/Makefile.linux
@@ -225,7 +225,7 @@ customflags =
 
 # ---------------------- END OF CUSTOMIZABLE OPTIONS -------------------------
 
-CFLAGS = -g $(sysconfigflags) $(prereleaseflags)
+CFLAGS = -fcommon -g $(sysconfigflags) $(prereleaseflags)
 
 # Don't worry about these -- for development purposes only.
 PURIFY = purify

As the Gentoo wiki points out, though, this is not an ideal solution. It also outlines nicely what should be done instead.

@vain
Copy link
Author

vain commented Sep 15, 2020

Sorry, forgot to add the actual errors that I get:

/usr/bin/ld: ../libwww2/libwww.a(HTTP.o):/home/void/work/arch-packages/src/ncsa-mosaic/libwww2/../src/kcms.h:3: multiple definition of `KCMS_Enabled'; kcms.o:/home/void/work/arch-packages/src/ncsa-mosaic/src/kcms.h:3: first defined here
/usr/bin/ld: ../libwww2/libwww.a(HTTP.o):/home/void/work/arch-packages/src/ncsa-mosaic/libwww2/../src/kcms.h:4: multiple definition of `KCMS_Return_Format'; kcms.o:/home/void/work/arch-packages/src/ncsa-mosaic/src/kcms.h:4: first defined here
/usr/bin/ld: ../libhtmlw/libhtmlw.a(HTMLformat.o):/home/void/work/arch-packages/src/ncsa-mosaic/libhtmlw/HTMLformat.c:57: multiple definition of `Tv'; xpmread.o:/home/void/work/arch-packages/src/ncsa-mosaic/src/xpmread.c:84: first defined here
/usr/bin/ld: ../libhtmlw/libhtmlw.a(HTMLformat.o):/home/void/work/arch-packages/src/ncsa-mosaic/libhtmlw/HTMLformat.c:58: multiple definition of `Tz'; xpmread.o:/home/void/work/arch-packages/src/ncsa-mosaic/src/xpmread.c:85: first defined here
/usr/bin/ld: ../libhtmlw/libhtmlw.a(HTMLparse.o):/home/void/work/arch-packages/src/ncsa-mosaic/libhtmlw/HTMLparse.c:57: multiple definition of `Tv'; xpmread.o:/home/void/work/arch-packages/src/ncsa-mosaic/src/xpmread.c:84: first defined here
/usr/bin/ld: ../libhtmlw/libhtmlw.a(HTMLparse.o):/home/void/work/arch-packages/src/ncsa-mosaic/libhtmlw/HTMLparse.c:58: multiple definition of `Tz'; xpmread.o:/home/void/work/arch-packages/src/ncsa-mosaic/src/xpmread.c:85: first defined here

@ThePlaneGuy45
Copy link

dude, this is a browser from 1993, do you expect it to work on a modern computer?

@emrecio
Copy link

emrecio commented May 14, 2021

Fingers crossed @ThePlaneGuy45

@clausecker
Copy link
Collaborator

@ThePlaneGuy45 Why should it not work? I recall that I managed to build a Linux binary just a few years ago. The only problem since is that libpng has changed in incompatible ways, but even that can be patched easily.

@legooolas
Copy link

@ThePlaneGuy45 Builds and runs fine once the CFLAGS setting is changed when building with gcc 10, so this is still working -- and why not? :D

@neozeed
Copy link

neozeed commented Nov 8, 2022

I can confirm with Ubuntu 22.04.1 LTS & gcc 11.3.0 (gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)) that -fcommon lets it build & run!

@smallpotato000
Copy link

I can confirm with Ubuntu 22.04.1 LTS & gcc 11.3.0 (gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)) that -fcommon lets it build & run!

Yes. Ubuntu Mate 22.04.3 with gcc 11.4.0. Works after adding -fcommon to CFLAGS.

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

No branches or pull requests

7 participants