SDL-Hercules-390 / hyperion

The SDL Hercules 4.x Hyperion version of the System/370, ESA/390, and z/Architecture Emulator
Other
247 stars 92 forks source link

Hercules wont compile on my version of Linux - Duplicate symbols such as cmpxchg1_amd64 (and more) #532

Closed awichicago closed 1 year ago

awichicago commented 1 year ago

System: 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Hyperion Version: 4.5.0

Pack Refs:

# pack-refs with: peeled fully-peeled
38d96955b9f27c7444c1cc78b5d6bd555d206c9c refs/remotes/origin/develop
58578601d7a34fc11f050b0ac4fd425a4c0422eb refs/remotes/origin/master
2750a47dfcbe044d5a00a287eafd4ee6a1d6b141 refs/tags/FixIgnore
^c9993eee7978a41d46d5681ce7eca8f5fb4ed1c1
12d359f51723e87a430b61e9f18179a198a62d8f refs/tags/Release_4.1
^42b533fa815612ac584f2e58b054f2c5f7e0c767
b85534b4f356d6e561238bcd23d7979cfd12c7d5 refs/tags/Release_4.2
^dc7243b2b9d7e60a8c4716f8115c5b0c0e7b7ff9
9b5cbe3d8be1ef3d0fd7d5b370237e6456ad33cb refs/tags/Release_4.2.1
a4db82133c5b9f8b8047ee91fe76fc49fe0efde8 refs/tags/Release_4.3
a4db82133c5b9f8b8047ee91fe76fc49fe0efde8 refs/tags/Release_4.3.0
bf377f63ed4f943d107343c08195b6c2d66a7bf8 refs/tags/Release_4.4
3830358a8af7bb864156965196d12567faf06db0 refs/tags/Release_4.4.0
^bf377f63ed4f943d107343c08195b6c2d66a7bf8
bb904530f632580be80294fee492d2dc2450dcec refs/tags/Release_4.4.1
^d0ccfbc9a74dd0a77a75ac224025fc68f6a6617f
58578601d7a34fc11f050b0ac4fd425a4c0422eb refs/tags/Release_4.5

Error: After running ./confgure without error, I seem to be getting duplicate symbols:

  CCLD     libhercu.la
.libs/hdl.o: In function `cmpxchg1_amd64':
/usr/local/src/hercules-helper-master/hyperion/machdep.h:356: multiple definition of `cmpxchg1_amd64'
.libs/codepage.o:/usr/local/src/hercules-helper-master/hyperion/machdep.h:356: first defined here
.libs/hdl.o: In function `cmpxchg4_amd64':
/usr/local/src/hercules-helper-master/hyperion/machdep.h:373: multiple definition of `cmpxchg4_amd64'
.libs/codepage.o:/usr/local/src/hercules-helper-master/hyperion/machdep.h:373: first defined here
.libs/hdl.o: In function `cmpxchg8_amd64':
/usr/local/src/hercules-helper-master/hyperion/machdep.h:390: multiple definition of `cmpxchg8_amd64'
.libs/codepage.o:/usr/local/src/hercules-helper-master/hyperion/machdep.h:390: first defined here
.libs/hdl.o: In function `cmpxchg16_amd64':
/usr/local/src/hercules-helper-master/hyperion/machdep.h:402: multiple definition of `cmpxchg16_amd64'
.libs/codepage.o:/usr/local/src/hercules-helper-master/hyperion/machdep.h:402: first defined here
....

And it goes on for about 25 more symbols or so.

Any idea what this might be?

wrljet commented 1 year ago

Assuming you're running CentOS 7...

I have reproduced your issue on a CentOS 7.8 system with gcc 4.8.5.

Hercules builds correctly on CentOS 7.8 and gcc 7.5.

Our minimum required gcc version is 6.2.

Please run ./util/bldlvlck and report back with its output. This is described here in Step 4.

Bill

Fish-Git commented 1 year ago
.libs/hdl.o: In function `cmpxchg1_amd64':
/usr/local/src/hercules-helper-master/hyperion/machdep.h:356: multiple definition of `cmpxchg1_amd64'
.libs/codepage.o:/usr/local/src/hercules-helper-master/hyperion/machdep.h:356: first defined here

The line numbers where the error supposedly occurs are not even being reported correctly. They're all reporting that the error is occurring on the __asm__ statement instead of the statement where the function is actually being defined:

https://github.com/SDL-Hercules-390/hyperion/blob/58578601d7a34fc11f050b0ac4fd425a4c0422eb/machdep.h#L352-L365

And even that isn't consistent. The supposed error for the cmpxchg16_amd64 function for example, is the only one of the reported errors that correctly identifies the line number where the error supposedly occurs:

https://github.com/SDL-Hercules-390/hyperion/blob/58578601d7a34fc11f050b0ac4fd425a4c0422eb/machdep.h#L402-L413

But of course ALL of the "errors" are completely BOGUS.

As you've identified he's probably using a garbage compiler.  

wrljet commented 1 year ago

We have been through these before, and it is one of the reasons we no longer support older gccs.

awichicago commented 1 year ago

I think the issue is that I have 4.85 gcc - I have 6.2 installed but I can't seem to figure out how to get the build process to use gcc 6.2 (its in a separate folder - 4.85 is still installed). yum won't update 4.85 automatically.

wrljet commented 1 year ago

I built my gcc 7.5 from source, so the directories will be different, but you use something like this before running your build process:

export CC=<path-to-your-gcc>/bin/gcc

Then start over with ./configure.

Bill

wrljet commented 1 year ago

And I would like to see the output from ./util/bldlvlck, just so I'm better able to understand what you have.

awichicago commented 1 year ago

I finally got it to compile using GCC 8.

Here is the ./util/bldlvlck output:

Machine architecture is x86_64

OK      autoconf requires 2.64, found 2.69
OK      automake requires 1.9, found 1.13.4
OK      bash requires 3.2, found 4.2.46
OK      cmake requires 3.2, found 3.25.1
OK      flex requires 2.5, found 2.5.37
OK      gawk requires 3.0, found 4.0.2
OK      gcc requires 6.2.0, found gcc 8.3.1
OK      grep requires 1, found 2.20
OK      ld requires 2.22, found 2.30.55

UPGRADE libtool requires 2.4.6, found 2.4.2
        URL: https://sdl-hercules-390.github.io/html/hercinst.html

OK      ltdl.h required include file, found
OK      m4 requires 1.4.6, found 1.4.16
OK      make requires 3.79, found 4.2.1
OK      perl requires 5.6, found 5.16.3
OK      sed requires 3.02, found 4.2.2
wrljet commented 1 year ago

Glad it's working!