SDL-Hercules-390 / hyperion

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

Compile errors on aarch 64 example: ltdl.c:412:15: error: invalid use of void expression dest[i] = src[i]; #418

Closed Shanghai-Tom closed 3 years ago

Shanghai-Tom commented 3 years ago

I am receiving several Errors compiling on aarch64 arm-a72 (Raspberry PI4B) and the compile terminates.

Thanks in advance for any pointers / fixes.

Most common error is:

ltdl.c:412:15: error: invalid use of void expression
       dest[i] = src[i];
               ^

Secondary Error:

ltdl.c: At top level:
ltdl.c:877:39: error: \u2018LTDL_OBJDIR\u2019 undeclared here (not in a function); did you mean \u2018LT_OBJDIR\u2019?
 static  const char  objdir[]        = LTDL_OBJDIR;
                                       ^~~~~~~~~~~
                                       LT_OBJDIR

sdl42 was retrieved by: git clone https://github.com/SDL-Hercules-390/hyperion on Tuesday 31 Aug approx. 15:00 GMT.

Directory structure is:

/DATA/hyperion/
              extpkgs
              herc42
              sdl42

Compilation of extpkgs completed successfully.

Configured by: ./configure --enable-optimization="-mcpu=cortex-a72 -mtune=cortex-a72 -frename-registers" --prefix=/DATA/hyperion/herc42 --enable-extpkgs=/DATA/hyperion/extpkgs.

Command: make -j 4

make  all-recursive
make[1]: Entering directory '/DATA/hyperion/sdl42/hyperion'
Making all in m4
make[2]: Entering directory '/DATA/hyperion/sdl42/hyperion/m4'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/DATA/hyperion/sdl42/hyperion/m4'
Making all in util
make[2]: Entering directory '/DATA/hyperion/sdl42/hyperion/util'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/DATA/hyperion/sdl42/hyperion/util'
Making all in html
make[2]: Entering directory '/DATA/hyperion/sdl42/hyperion/html'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/DATA/hyperion/sdl42/hyperion/html'
Making all in man
make[2]: Entering directory '/DATA/hyperion/sdl42/hyperion/man'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/DATA/hyperion/sdl42/hyperion/man'
Making all in .
make[2]: Entering directory '/DATA/hyperion/sdl42/hyperion'
  CC       ltdl.lo
  CC       sllib.lo
  CC       ftlib.lo
  CC       cache.lo
ltdl.c: In function \u2018rpl_memcpy\u2019:
ltdl.c:412:11: warning: dereferencing \u2018void *\u2019 pointer
       dest[i] = src[i];
           ^
ltdl.c:412:20: warning: dereferencing \u2018void *\u2019 pointer
       dest[i] = src[i];
                    ^
ltdl.c:412:15: error: invalid use of void expression
       dest[i] = src[i];
               ^
ltdl.c: In function \u2018rpl_memmove\u2019:
ltdl.c:437:9: warning: dereferencing \u2018void *\u2019 pointer
     dest[i] = src[i];
         ^
ltdl.c:437:18: warning: dereferencing \u2018void *\u2019 pointer
     dest[i] = src[i];
                  ^
ltdl.c:437:13: error: invalid use of void expression
     dest[i] = src[i];
             ^
ltdl.c:440:25: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     for (i = size -1; i >= 0; --i)
                         ^~
ltdl.c:442:9: warning: dereferencing \u2018void *\u2019 pointer
     dest[i] = src[i];
         ^
ltdl.c:442:18: warning: dereferencing \u2018void *\u2019 pointer
     dest[i] = src[i];
                  ^
ltdl.c:442:13: error: invalid use of void expression
     dest[i] = src[i];
             ^
ltdl.c: At top level:
ltdl.c:877:39: error: \u2018LTDL_OBJDIR\u2019 undeclared here (not in a function); did you mean \u2018LT_OBJDIR\u2019?
 static  const char  objdir[]        = LTDL_OBJDIR;
                                       ^~~~~~~~~~~
                                       LT_OBJDIR
ltdl.c: In function \u2018find_file_callback\u2019:
ltdl.c:364:21: warning: initialization discards \u2018const\u2019 qualifier from pointer target type [-Wdiscarded-qualifiers]
 #    define strrchr rpl_strrchr
                     ^~~~~~~~~~~
ltdl.c:2761:22: note: in expansion of macro \u2018strrchr\u2019
       char *dirend = strrchr (filename, '/');
                      ^~~~~~~
ltdl.c: In function \u2018try_dlopen\u2019:
ltdl.c:3110:13: warning: assignment discards \u2018const\u2019 qualifier from pointer target type [-Wdiscarded-qualifiers]
   base_name = strrchr (canonical, '/');
             ^
ltdl.c:3163:13: warning: implicit declaration of function \u2018isalnum\u2019 [-Wimplicit-function-declaration]
         if (isalnum ((int)(base_name[i])))
             ^~~~~~~
ltdl.c:3305:28: warning: assignment discards \u2018const\u2019 qualifier from pointer target type [-Wdiscarded-qualifiers]
           && (last_libname = strrchr (dlname, ' ')) != 0)
                            ^
ltdl.c: In function \u2018lt_dlopenext\u2019:
ltdl.c:3483:7: warning: assignment discards \u2018const\u2019 qualifier from pointer target type [-Wdiscarded-qualifiers]
   ext = strrchr (filename, '.');
       ^
At top level:
ltdl.c:422:19: warning: \u2018rpl_memmove\u2019 defined but not used [-Wunused-function]
 #  define memmove rpl_memmove
                   ^~~~~~~~~~~
ltdl.c:427:1: note: in expansion of macro \u2018memmove\u2019
 memmove (dest, src, size)
 ^~~~~~~
ltdl.c:398:20: warning: \u2018rpl_memcpy\u2019 defined but not used [-Wunused-function]
 #    define memcpy rpl_memcpy
                    ^~~~~~~~~~
ltdl.c:403:1: note: in expansion of macro \u2018memcpy\u2019
 memcpy (dest, src, size)
 ^~~~~~
make[2]: *** [Makefile:2518: ltdl.lo] Error 1
wrljet commented 3 years ago

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

Scroll down a ways and you'll see a list of required packages for various systems.

Please let us know what OS you're running on your Pi.

Bill

Shanghai-Tom commented 3 years ago

Hi Bill, Many thanks for the fast response!   :)

My system is:

cat /etc/*release

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian

uname -a results in:

Linux PI-4B 5.10.52-v8+ #1441 SMP PREEMPT Tue Aug 3 18:14:03 BST 2021 **aarch64** GNU/Linux

My repositories include:

deb       http://archive.raspberrypi.org/debian/ buster
deb       http://deb.debian.org/debian/              buster

When compiling the extpkgs, I had to change the .ini file to say aarch64. I am not sure if the ./configure will accept that, but the general consensus for pi4b is to use cortex-a72 because that is the cpu model.

I did start with that web page you mentioned, and therefore checked my actions as far back as I could, but my terminal session rollback was not large enough, so I have increased it to re-run the process.

As a precaution - because I saw libltdl-dev and my issue is with ltdl - I downloaded all the necessary packages again, and re-ran, this time getting much further past the ltdl point before encountering another error, I can only assume the previous download of ltdl didn't complete / failed and I missed it.

Prior to re-running the process I first ran make clean, then ./configure again, then make.

The error now is regarding storage_key as shown briefly below. The full log is attached as a .txt file, along with skey.c and .h.

I had to rename the .c and .h files with post-suffix of .txt so that GitHub would allow me to attach them.

 CC       stack.lo
skey.c:123:22: warning: inline function ‘bypass_skey_update’ declared but never defined
   extern inline bool bypass_skey_update( REGS* regs, BYTE m3, BYTE oldkey, BYTE r1key );
                      ^~~~~~~~~~~~~~~~~~
In file included from hercules.h:38,
                 from skey.c:13,
                 from skey.c:100:
feature.h:483:29: warning: inline function ‘z900__get_dev_storage_key’ declared but never defined
 #define ARCH_DEP(_name)     z900_ ## _name
                             ^~~~~
skey.c:84:20: note: in expansion of macro ‘ARCH_DEP’
 extern inline BYTE ARCH_DEP(  _get_dev_storage_key  )( DEVBLK* dev, U64 abs,            BYTE K );
                    ^~~~~~~~
feature.h:483:29: warning: inline function ‘z900__or_dev_storage_key’ declared but never defined
 #define ARCH_DEP(_name)     z900_ ## _name
                             ^~~~~
skey.c:83:20: note: in expansion of macro ‘ARCH_DEP’
 extern inline void ARCH_DEP(  _or_dev_storage_key   )( DEVBLK* dev, U64 abs, BYTE bits, BYTE K );
                    ^~~~~~~~
feature.h:483:29: warning: inline function ‘z900__and_storage_key’ declared but never defined
 #define ARCH_DEP(_name)     z900_ ## _name
                             ^~~~~
skey.c:82:20: note: in expansion of macro ‘ARCH_DEP’
 extern inline void ARCH_DEP(  _and_storage_key      )(              U64 abs, BYTE bits, BYTE K );
                    ^~~~~~~~
feature.h:483:29: warning: inline function ‘z900__or_storage_key’ declared but never defined
 #define ARCH_DEP(_name)     z900_ ## _name
                             ^~~~~

This repeats for s370 and s390 for many messages, and references 4k and 2k keys, eventually showing up in short-form later.

As a short example :

/usr/bin/ld: ./.libs/libherc.so: undefined reference to `bypass_skey_update'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `z900__get_storage_key'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `z900_get_storekey_by_ptr'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s370__or_storage_key'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s390_put_storage_key'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s370_and_4K_storage_key'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s390_get_dev_storage_key'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `z900_and_storage_key'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s370_get_storekey_by_ptr'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s370_get_storage_key'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s390_get_ptr_to_storekey'
/usr/bin/ld: ./.libs/libherc.so: undefined reference to `s370_get_2K_storage_key'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2268: hercules] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:2264: herclin] Error 1

The process then fails.

Many thanks,

Tom.

  As an aside, the prebuilt hercules in the debian pi repo (3.13-1) does execute, just does not perform very well.

wrljet commented 3 years ago

The compiling issues you've run into now are a semi-known issue.

You may not be aware that the head of the master branch is where active development work is being done, and not always guaranteed to build or run correctly. The goal of course is that is always "just works" but that's not always the reality on all systems and compilers.

For the Pi, may I suggest you try out my Hercules-Helper project.

If you use the default config file it will check out and build a slightly older version of SDL Hercules so you shouldn't run into the problems you're seeing (related to function inlining).

Read all the (out of date, incomplete) instructions before running it.

Assuming it works, then you can examine what it's doing (it will leave a log behind of commands needed to reproduce what it did). The logs include loads of diagnostic info which will help track down any problems.

Bill

Shanghai-Tom commented 3 years ago

Many thanks Bill! I'll investigate tomorrow, as it's quite late in the day here for me.   :thumbsup:

wrljet commented 3 years ago

Are you running the RPIOS 64-bit beta?

Shanghai-Tom commented 3 years ago

Yes, the 64 bit is still beta, but there are very few 'warts' that will affect me, such as builtin camera adapter support. Everything else I use it for works absolutely fine.

I download the 'lite' version (which has no gui, etc), and installed xfce on it, and then populated a few favorite apps and x2go server for enhanced 'remote' desktop access while I build it out.

Regards,

Tom

wrljet commented 3 years ago

Tom,

Should work just fine. Just wanted to make sure what you were using, so when I double check things here, I will use the correct OS.

Bill

Shanghai-Tom commented 3 years ago

Sent a direct email regarding the helper script with some comments and results, happy to close this one out now.

Thanks Bill.

Shanghai-Tom commented 3 years ago

Email resent, Rgds, Tom.


From: Bill Lewis @.> Sent: 01 September 2021 20:33 To: SDL-Hercules-390/hyperion @.> Cc: Shanghai-Tom @.>; State change @.> Subject: Re: [SDL-Hercules-390/hyperion] Compile errors on aarch 64 example: ltdl.c:412:15: error: invalid use of void expression dest[i] = src[i]; (#418)

Tom, I didn't get an email from you. Try resending to @.**@.>

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/SDL-Hercules-390/hyperion/issues/418#issuecomment-910633485, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOMRI4JFMJBJJJKQZJAM2J3T7Z5Y3ANCNFSM5DEQG4YQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

wrljet commented 3 years ago

Official Hercules building documentation has been somewhat improved: