hercules-390 / hyperion

Hercules 390
Other
251 stars 69 forks source link

Mac OS X 10.10.4 - ld: symbol(s) not found for architecture x86_64 #60

Closed hackob closed 9 years ago

hackob commented 9 years ago

Configure options: --enable-optimization=no

Make output:

$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in .
/bin/sh ./libtool  --tag=CC   --mode=link gcc  -W -Wall  -g3 -ggdb3 -export-dynamic  -no-undefined -avoid-version  -o libherc.la -rpath /usr/local/lib hconsole.lo w32util.lo strsignal.lo impl.lo config.lo bldcfg.lo script.lo archlvl.lo panel.lo history.lo fillfnam.lo ipl.lo assist.lo dat.lo stack.lo cpu.lo vstore.lo general1.lo general2.lo general3.lo pfpo.lo plo.lo control.lo crypto.lo io.lo decimal.lo service.lo scedasd.lo scescsi.lo losc.lo chsc.lo opcode.lo diagnose.lo diagmssf.lo vm.lo vmd250.lo hdiagf18.lo dyn76.lo channel.lo external.lo float.lo trace.lo machchk.lo vector.lo xstore.lo cmpsc_2012.lo cmpscdbg.lo cmpscdct.lo cmpscget.lo cmpscmem.lo cmpscput.lo sie.lo qdio.lo clock.lo timer.lo esame.lo ieee.lo SoftFloat.lo dfp.lo httpserv.lo cgibin.lo loadmem.lo loadparm.lo hsccmd.lo hscemode.lo hscpufun.lo hscloc.lo cmdtab.lo hao.lo hscmisc.lo sr.lo  ecpsvm.lo hRexx.lo hRexx_o.lo hRexx_r.lo libhercs.la libhercu.la libherct.la libhercd.la decNumber/libdecNumber.la -lz -lresolv -lm -ldl  -pthread -lbz2 -lz -lresolv -lm -ldl  -pthread -lbz2
gcc -dynamiclib  -o .libs/libherc.dylib  .libs/hconsole.o .libs/w32util.o .libs/strsignal.o .libs/impl.o .libs/config.o .libs/bldcfg.o .libs/script.o .libs/archlvl.o .libs/panel.o .libs/history.o .libs/fillfnam.o .libs/ipl.o .libs/assist.o .libs/dat.o .libs/stack.o .libs/cpu.o .libs/vstore.o .libs/general1.o .libs/general2.o .libs/general3.o .libs/pfpo.o .libs/plo.o .libs/control.o .libs/crypto.o .libs/io.o .libs/decimal.o .libs/service.o .libs/scedasd.o .libs/scescsi.o .libs/losc.o .libs/chsc.o .libs/opcode.o .libs/diagnose.o .libs/diagmssf.o .libs/vm.o .libs/vmd250.o .libs/hdiagf18.o .libs/dyn76.o .libs/channel.o .libs/external.o .libs/float.o .libs/trace.o .libs/machchk.o .libs/vector.o .libs/xstore.o .libs/cmpsc_2012.o .libs/cmpscdbg.o .libs/cmpscdct.o .libs/cmpscget.o .libs/cmpscmem.o .libs/cmpscput.o .libs/sie.o .libs/qdio.o .libs/clock.o .libs/timer.o .libs/esame.o .libs/ieee.o .libs/SoftFloat.o .libs/dfp.o .libs/httpserv.o .libs/cgibin.o .libs/loadmem.o .libs/loadparm.o .libs/hsccmd.o .libs/hscemode.o .libs/hscpufun.o .libs/hscloc.o .libs/cmdtab.o .libs/hao.o .libs/hscmisc.o .libs/sr.o .libs/ecpsvm.o .libs/hRexx.o .libs/hRexx_o.o .libs/hRexx_r.o  /Users/ricardo/Documents/Desarrollo/net.hackob/hyperion/.libs/libhercu.dylib /Users/ricardo/Documents/Desarrollo/net.hackob/hyperion/.libs/libhercs.dylib ./.libs/libhercs.dylib ./.libs/libhercu.dylib ./.libs/libherct.dylib ./.libs/libhercd.dylib decNumber/.libs/libdecNumber.dylib -lz -lresolv -lm -ldl -lbz2 -install_name  /usr/local/lib/libherc.dylib 
Undefined symbols for architecture x86_64:
  "_cpu_reset_instcount_and_cputime", referenced from:
      _s370_system_reset in ipl.o
      _s390_system_reset in ipl.o
      _z900_system_reset in ipl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libherc.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I cannot figure out which symbol is missing.

andrepnd commented 9 years ago

I am facing the same problem here, can it be somehow related to this? http://stackoverflow.com/a/25080111

ghost commented 9 years ago

André wrote:

I am facing the same problem here, can it be somehow related to this? http://stackoverflow.com/a/25080111

No. I know what the problem is and already have a fix. I've just been very busy and have not had time to test it on my VMware CentOS system yet before committing it.

If you're interested in trying it for yourself, this is the fix:

--- hercules-1/ipl.c    2014-03-17 17:04:01.998602400 -0700
+++ hercules-0/ipl.c    2015-09-01 13:39:26.509472000 -0700
@@ -36,7 +36,7 @@
 /*-------------------------------------------------------------------*/
 #if !defined(_reset_instcount_)
 #define _reset_instcount_
-INLINE void
+static INLINE void
 cpu_reset_instcount_and_cputime(REGS* regs)
 {
     /* Reset instruction counts, I/O counts and real CPU time */
@@ -60,7 +60,7 @@
 /*-------------------------------------------------------------------*/
 #if !defined(_subsystem_reset_)
 #define _subsystem_reset_
-void subsystem_reset (void)
+static INLINE void subsystem_reset (void)
 {
     /* Perform subsystem reset
      *

The function cpu_reset_instcount_and_cputime was declared as simply INLINE instead of static INLINE.

Details of the problem can be found here: http://clang.llvm.org/compatibility.html#inline

andrepnd commented 9 years ago

Thanks @Fish-Git2 , I have tested it on my OSX 10.10.5, the make command worked after using this fix, then I got this error on make install: use of undeclared identifier 'ptrdiff_t' I included #include <stddef.h> in the file console.c and it installed without errors, now Hercules seems to be running without problems. I'll try to install a z/OS image later.

ghost commented 9 years ago

Fix committed. Issue closed.