SDL-Hercules-390 / hyperion

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

Fails to build on Ubuntu 21.04 system #432

Closed fsword7 closed 2 years ago

fsword7 commented 2 years ago

Tried to compile Hercules (Hyperion) but it crashed middle of compiling with serious errors.

Thanks, Tim

GCC version:

gcc --version
gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0

Compiling:

make[2]: Entering directory '/home/sword7/hercules/hyperion'
  CC       cckdcdsk.o
  CC       hsys.lo
  CCLD     libhercs.la
  CC       codepage.lo
  CC       hdl.lo
  CC       hexdumpe.lo
  CC       hostinfo.lo
  CC       hscutl.lo
  CC       hsocket.lo
  CC       hthreads.lo
  CC       logger.lo
  CC       logmsg.lo
  CC       memrchr.lo
  CC       parser.lo
  CC       pttrace.lo
  CC       version.lo
  CC       ltdl.lo
ltdl.c: In function ‘rpl_memcpy’:
ltdl.c:412:11: warning: dereferencing ‘void *’ pointer
  412 |       dest[i] = src[i];
      |           ^
ltdl.c:412:20: warning: dereferencing ‘void *’ pointer
  412 |       dest[i] = src[i];
      |                    ^
ltdl.c:412:15: error: invalid use of void expression
  412 |       dest[i] = src[i];
      |               ^
ltdl.c: In function ‘rpl_memmove’:
ltdl.c:437:9: warning: dereferencing ‘void *’ pointer
  437 |     dest[i] = src[i];
      |         ^
ltdl.c:437:18: warning: dereferencing ‘void *’ pointer
  437 |     dest[i] = src[i];
      |                  ^
ltdl.c:437:13: error: invalid use of void expression
  437 |     dest[i] = src[i];
      |             ^
ltdl.c:440:25: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
  440 |     for (i = size -1; i >= 0; --i)
      |                         ^~
ltdl.c:442:9: warning: dereferencing ‘void *’ pointer
  442 |     dest[i] = src[i];
      |         ^
ltdl.c:442:18: warning: dereferencing ‘void *’ pointer
  442 |     dest[i] = src[i];
      |                  ^
ltdl.c:442:13: error: invalid use of void expression
  442 |     dest[i] = src[i];
      |             ^
ltdl.c: At top level:
ltdl.c:877:39: error: ‘LTDL_OBJDIR’ undeclared here (not in a function); did you mean ‘LT_OBJDIR’?
  877 | static  const char  objdir[]        = LTDL_OBJDIR;
      |                                       ^~~~~~~~~~~
      |                                       LT_OBJDIR
ltdl.c: In function ‘find_file_callback’:
ltdl.c:364:21: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  364 | #    define strrchr rpl_strrchr
      |                     ^~~~~~~~~~~
ltdl.c:2761:22: note: in expansion of macro ‘strrchr’
 2761 |       char *dirend = strrchr (filename, '/');
      |                      ^~~~~~~
ltdl.c: In function ‘try_dlopen’:
ltdl.c:3110:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 3110 |   base_name = strrchr (canonical, '/');
      |             ^
ltdl.c:3163:13: warning: implicit declaration of function ‘isalnum’ [-Wimplicit-function-declaration]
 3163 |         if (isalnum ((int)(base_name[i])))
      |             ^~~~~~~
ltdl.c:3305:28: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 3305 |           && (last_libname = strrchr (dlname, ' ')) != 0)
      |                            ^
ltdl.c: In function ‘lt_dlopenext’:
ltdl.c:3483:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 3483 |   ext = strrchr (filename, '.');
      |       ^
At top level:
ltdl.c:422:19: warning: ‘rpl_memmove’ defined but not used [-Wunused-function]
  422 | #  define memmove rpl_memmove
      |                   ^~~~~~~~~~~
ltdl.c:427:1: note: in expansion of macro ‘memmove’
  427 | memmove (dest, src, size)
      | ^~~~~~~
ltdl.c:398:20: warning: ‘rpl_memcpy’ defined but not used [-Wunused-function]
  398 | #    define memcpy rpl_memcpy
      |                    ^~~~~~~~~~
ltdl.c:403:1: note: in expansion of macro ‘memcpy’
  403 | memcpy (dest, src, size)
      | ^~~~~~
make[2]: *** [Makefile:2518: ltdl.lo] Error 1
wrljet commented 2 years ago

Timothy,

You're probably missing the libtool development files, which for Ubuntu are in libltdl-dev.

sudo apt install -y autoconf automake libtool libltdl-dev

A list of packages for various *nix systems can be found here:

Bill

wrljet commented 2 years ago

Also, just FYI: a fix so that specific situation is discovered much earlier, in configure, is pending and should be in the repo soon.

fsword7 commented 2 years ago

Yeah. Thanks for quick reply. I now successfully built it into binaries. I just got a few warnings but not necessary.

Put that note into README for Ubuntu systems. I can’t find any instruction about building it on Ubuntu systems.

Thanks for your help.

Tim

fsword7 commented 2 years ago

Also thanks for another reply about useful information about how to compile Hercules. Now closed.

https://sdl-hercules-390.github.io/html/hercinst.html#install