Page 1 of 1

Minimum required macOS version?

Posted: Tue Mar 07, 2023 8:33 pm
by garrafonsoftware
Hi all!

I want to use latest z88dk in a macOS 10.13 High Sierra setup. But I don't seem to succeed. :/

Downloading latest nightly build for OSX: http://nightly.z88dk.org/z88dk-osx-latest.zip, when trying to compile the simplest C program it yields this error:
zcc +zx -vn -startup=0 -clib=sdcc_iy main.c -o main -create-app
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from: /Users/None/Documents/Webs/z88dk/bin/z88dk-zsdcpp (which was built for Mac OS X 11.0)
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ____chkstk_darwin
Referenced from: /Users/None/Documents/Webs/z88dk/bin/z88dk-zsdcpp (which was built for Mac OS X 11.0)
Expected in: /usr/lib/libSystem.B.dylib

make: *** [all] Error 1
and if I try to build z88dk from scratch cloned from Git and running ./build.sh, another error happens:
gcc -std=gnu11 -MMD -Wall -O3 -I. -Isrc -Isrc/c -It -I../common -I../../ext/optparse -I../../ext/regex -I../../ext/uthash/src -g -O2 -c -o ../../ext/regex/regfree.o ../../ext/regex/regfree.c
c++ -std=gnu++17 -MMD -Wall -O3 -I. -Isrc -Wextra -Werror -pedantic-errors -Isrc/cpp -c -o src/cpp/args.o src/cpp/args.cpp
In file included from src/cpp/args.cpp:8:
In file included from src/cpp/args.h:10:
src/cpp/utils.h:22:11: fatal error: 'experimental/filesystem' file not found
#include <experimental/filesystem>
^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [src/cpp/args.o] Error 1
make: *** [bin/z88dk-z80asm] Error 2
My version of the Apple LLVM installation is:
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
Am I missing something? Any hint? Or is macOS 10.1x unsupported?

Thanks in advance! :)

Re: Minimum required macOS version?

Posted: Tue Mar 07, 2023 10:05 pm
by dom
I don't think we've ever specified it.

However, from what I can see, the core z88dk binaries seem to run (could you check z80asm please?) and it's just the sdcc part that's failing.

That does make sense since sdcc is the only thing built on my laptop, everything else is cross compiled.

I will need to rebuild sdcc to add an arm64 variant, so I should see if I can support an older Intel version and arm64 from the same fat binary. In the meantime, I'm hoping the only thing you need to rebuild will be sdcc - details on the wiki of how to do that.

Re: Minimum required macOS version?

Posted: Wed Mar 08, 2023 10:28 am
by dom
Can you try to download the binaries here: http://nightly.z88dk.org/misc/macos_sdcc_10.10_fat.zip these are compiled as fat binaries targeting MacOS 10.10 (random choice since 10.6 didn't work)

They work on a Mojave machine I've got about the place. If they're good for you I'll drop them into the nightly builds.

Re: Minimum required macOS version?

Posted: Wed Mar 08, 2023 11:00 am
by jorgegv
Just out of curiosity, Dom: why can't be SDCC compiled along the rest of the Z88DK tools, as it is done in Linux? (and not in your machine, I mean)

Re: Minimum required macOS version?

Posted: Wed Mar 08, 2023 11:14 am
by dom
jorgegv wrote: Wed Mar 08, 2023 11:00 amJust out of curiosity, Dom: why can't be SDCC compiled along the rest of the Z88DK tools, as it is done in Linux? (and not in your machine, I mean)
When I setup the build machine years ago it was running crosstool which didn't have a copy of boost so I had to do it locally on my machine.

A few upgrades later and now running with osxcross I was still having trouble with the correct incantation of CFLAGS, CXXFLAGS, CPPFLAGS, and configure options to get a clean build. So given that we tend to just upgrade on releases I stuck with the manual process.

Though I may have finally figured out the magic today:

Code: Select all

build@build3:~/sdcc-build/bin$ file sdcc
sdcc: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|PIE>] [arm64]
build@build3:~/sdcc-build/bin$ file sdcpp
sdcpp: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>] [arm64:Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>]

Code: Select all

% export CFLAGS="-g -O2 -arch x86_64 -arch arm64 -mmacosx-version-min=10.10"
% export CXXFLAGS="-g -O2 -arch x86_64 -arch arm64 -mmacosx-version-min=10.10"
% export CPPFLAGS="-I/opt/osxcross/macports/pkgs/opt/local/libexec/boost/1.76/include"
% ./configure --host=x86_64-apple-darwin20.2 --disable-ds390-port --disable-ds400-port --disable-hc08-port --disable-s08-port --disable-mcs51-port --disable-pic-port --disable-pic14-port --disable-pic16-port --disable-tlcs90-port --disable-xa51-port --disable-stm8-port  --disable-pdk13-port --disable-pdk14-port --disable-pdk15-port --disable-pdk16-port --disable-mos6502-port --disable-mos65c02-port --disable-r2k-port --disable-ucsim --disable-device-lib --disable-packihx
% make

Re: Minimum required macOS version?

Posted: Wed Mar 08, 2023 12:07 pm
by jorgegv
dom wrote: Wed Mar 08, 2023 11:14 am Though I may have finally figured out the magic today:
Congrats then!

Re: Minimum required macOS version?

Posted: Wed Mar 08, 2023 6:15 pm
by garrafonsoftware
dom wrote: Wed Mar 08, 2023 10:28 am Can you try to download the binaries here: http://nightly.z88dk.org/misc/macos_sdcc_10.10_fat.zip these are compiled as fat binaries targeting MacOS 10.10 (random choice since 10.6 didn't work)

They work on a Mojave machine I've got about the place. If they're good for you I'll drop them into the nightly builds.
They work! :O

Re: Minimum required macOS version?

Posted: Thu Mar 09, 2023 8:38 pm
by garrafonsoftware
Sadly going a step further, now is z88dk-z80asm which needs a higher macOS version:
zcc +zx -vn -startup=0 -clib=new -O2 -zorg=32768 main.c -o main.tap -create-app -pragma-include:zpragma.inc
dyld: lazy symbol binding failed: Symbol not found: __ZNKSt3__14__fs10filesystem4path11__extensionEv
Referenced from: /Users/None/Documents/Webs/../../z88dk/bin/z88dk-z80asm (which was built for Mac OS X 10.16)
Expected in: /usr/lib/libc++.1.dylib

dyld: Symbol not found: __ZNKSt3__14__fs10filesystem4path11__extensionEv
Referenced from: /Users/None/Documents/Webs/../../z88dk/bin/z88dk-z80asm (which was built for Mac OS X 10.16)
Expected in: /usr/lib/libc++.1.dylib

make: *** [all] Error 1
Seems that z88dk-z80asm requires some C++17 features that require macOS 10.16 or above? (See error compiling in my 1st post of this thread) :(

Re: Minimum required macOS version?

Posted: Thu Mar 09, 2023 10:02 pm
by dom
Hmmm...I can't see a way around this one. There was the same issue on windows which was resolved by statically linking, but I don't think that's possible for MacOS.

The change went in July last year, so you could lift a z80asm from before then. The alternative would be to run z88dk using Docker.

Re: Minimum required macOS version?

Posted: Fri Mar 10, 2023 8:40 am
by garrafonsoftware
Ok, I will try with the Dockerfile this weekend then.

Thanks for the support, Dom! ;)

Re: Minimum required macOS version?

Posted: Fri Mar 10, 2023 9:00 am
by dom
Sorry about that, it's a bit annoying that although we support back to Windows XP, the lack of a static libc++ on macOS means that we can only go back a couple of years.

We could use the boost equivalent, but I'll see what Paulo thinks

Re: Minimum required macOS version?

Posted: Fri Mar 10, 2023 7:20 pm
by garrafonsoftware
Docker image worked great! So I will stick to using that.

Thanks again!