Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build for SMING_ARCH=Host in Apple M1 Pro #2773

Closed
mtzfactory opened this issue May 24, 2024 · 15 comments
Closed

Can't build for SMING_ARCH=Host in Apple M1 Pro #2773

mtzfactory opened this issue May 24, 2024 · 15 comments

Comments

@mtzfactory
Copy link

I'm trying to build the basic blink example to debug it in my host machine (Apple M1 Pro) but it fails with the following error:

❯ make SMING_ARCH=Host

Basic_Blink: Invoking 'all' for Host (debug) architecture
/Applications/Xcode.app/Contents/Developer/usr/bin/make components application

Building /Users/xxxxxx/development/personal/espressif/sming/Sming/out/Host/debug/lib/clib-Storage-1766cf74635c72591842b6a122154060.a
clang: error: unknown argument: '-fstrict-volatile-bitfields'
clang: error: -Wl,-EL: 'linker' input unused [-Werror,-Wunused-command-line-argument]
make[2]: *** [src/Debug.cpp.d] Error 1
make[1]: *** [Storage-build] Error 2
make: *** [all] Error 2
@mtzfactory mtzfactory changed the title Can't build for SMING_ARCH=Host in an Apple M1 Pro Can't build for SMING_ARCH=Host in Apple M1 Pro May 24, 2024
@mikee47
Copy link
Contributor

mikee47 commented May 24, 2024

You have CLANG_TIDY defined (added in #2648). If this is problematic perhaps we should rename that variable, e.g. SMING_CLANG_TIDY ?

@mikee47
Copy link
Contributor

mikee47 commented May 24, 2024

Actually, might not be this... Try posting a dump of make V=1 so we can see compiler options, etc.

@mtzfactory
Copy link
Author

@mikee47 thanks for your response...

This is the log from command make V=1

❯ make SMING_ARCH=Host

sming-test: Invoking 'all' for Host (debug) architecture
Using configuration 'standard'
/Applications/Xcode.app/Contents/Developer/usr/bin/make components application

Building /Users/rmartinez/development/personal/espressif/sming/Sming/out/Host/debug/lib/clib-Storage-1766cf74635c72591842b6a122154060.a
clang: error: unknown argument: '-fstrict-volatile-bitfields'
clang: error: -Wl,-EL: 'linker' input unused [-Werror,-Wunused-command-line-argument]
make[2]: *** [src/Debug.cpp.d] Error 1
make[1]: *** [Storage-build] Error 2
make: *** [all] Error 2

❯ make V=1
PYTHON_VERSION = Python 3.12.3

sming-test: Invoking 'all' for Host (debug) architecture
-- Parsing App
-- Parsing Sming
-- Parsing Storage
-- Parsing sming-arch
-- Parsing driver
-- Parsing arch_driver
-- Parsing SerialLib
-- Parsing esp_hal
-- Parsing gdbstub
-- Parsing heap
-- Parsing malloc_count
-- Parsing hostlib
-- Parsing libc
-- Parsing spi_flash
-- Parsing vflash
-- Parsing rboot
-- Parsing FlashString
-- Parsing Spiffs
-- Parsing IFS
-- Parsing SPI
-- Parsing terminal
SUBMODULES_FETCHED:
/Applications/Xcode.app/Contents/Developer/usr/bin/make components application
PYTHON_VERSION = Python 3.12.3
-- Parsing App
-- Parsing Sming
-- Parsing Storage
-- Parsing sming-arch
-- Parsing driver
-- Parsing arch_driver
-- Parsing SerialLib
-- Parsing esp_hal
-- Parsing gdbstub
-- Parsing heap
-- Parsing malloc_count
-- Parsing hostlib
-- Parsing libc
-- Parsing spi_flash
-- Parsing vflash
-- Parsing rboot
-- Parsing FlashString
-- Parsing Spiffs
-- Parsing IFS
-- Parsing SPI
-- Parsing terminal

Building /Users/rmartinez/development/personal/espressif/sming/Sming/out/Host/debug/lib/clib-Storage-1766cf74635c72591842b6a122154060.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -r -R --no-print-directory -C /Users/rmartinez/development/personal/espressif/sming/Sming/out/Host/debug/build/Storage/Storage-1766cf74635c72591842b6a122154060 -f /Users/rmartinez/development/personal/espressif/sming/Sming/component-wrapper.mk COMPONENT_NAME=Storage COMPONENT_PATH=/Users/rmartinez/development/personal/espressif/sming/Sming/Components/Storage COMPONENT_BUILD_BASE=/Users/rmartinez/development/personal/espressif/sming/Sming/out/Host/debug/build/Storage COMPONENT_LIBDIR=/Users/rmartinez/development/personal/espressif/sming/Sming/out/Host/debug/lib COMPONENT_LIBNAME=Storage COMPONENT_LIBHASH=1766cf74635c72591842b6a122154060  build
PYTHON_VERSION = Python 3.12.3
WriteConfig /Users/rmartinez/development/personal/espressif/sming/Sming/out/Host/debug/build/Storage/Storage-1766cf74635c72591842b6a122154060/build.cfg
g++ -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components -I/Users/rmartinez/development/personal/espressif/sming/Sming/System/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Wiring -I/Users/rmartinez/development/personal/espressif/sming/Sming/Core -I/Users/rmartinez/development/personal/espressif/sming/Sming -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/Storage/src/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Core -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/driver/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/arch_driver/src/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/SerialLib -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/esp_hal/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Esp8266/Components/esp8266/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/gdbstub/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/heap/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/malloc_count/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/hostlib/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/libc/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/spi_flash/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Esp8266/Components/spi_flash/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Arch/Host/Components/vflash/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/rboot/rboot -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/rboot/rboot/appcode -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/rboot/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/FlashString/src/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Libraries/Spiffs/src/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/IFS/src/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/IFS/src/Arch/Host/include -I/Users/rmartinez/development/personal/espressif/sming/Sming/Libraries/SPI/src -I/Users/rmartinez/development/personal/espressif/sming/Sming/Libraries/SPI/src/Arch/Host -I/Users/rmartinez/development/personal/espressif/sming/Sming/Components/terminal/include -Wl,-EL -finline-functions -fdata-sections -ffunction-sections -fstrict-volatile-bitfields -Wall -Wpointer-arith -Wno-comment -DARDUINO=106 -Werror -Wno-parentheses -Wno-unused-variable -Wno-unused-but-set-variable -Os -g -DARCH_HOST -m32 -Wno-deprecated-declarations -D_FILE_OFFSET_BITS=64 -DSMING_ARCH=Host -DSMING_SOC=host -DPROJECT_DIR=\"/Users/rmartinez/development/personal/temp/sming-test\" -DSMING_HOME=\"/Users/rmartinez/development/personal/espressif/sming/Sming\" -DSOC_HOST=1 -DDISABLE_NETWORK=1 -DDISABLE_WIFI=1 -DDEBUG_PRINT_FILENAME_AND_LINE=0 -DCUST_FILE_BASE=Components/Storage/src/Debug.cpp -DDEBUG_VERBOSE_LEVEL=2 -DSTRING_OBJECT_SIZE=12 -DUSE_US_TIMER -DENABLE_MALLOC_COUNT -DCOMPONENT_PATH=\"/Users/rmartinez/development/personal/espressif/sming/Sming/Components/Storage\" -Werror -DPARTITION_TABLE_OFFSET=0x00002000 -felide-constructors -fno-rtti -fno-exceptions -std=c++17  -MM -MT src/Debug.o /Users/rmartinez/development/personal/espressif/sming/Sming/Components/Storage/src/Debug.cpp -MF src/Debug.cpp.d
clang: error: unknown argument: '-fstrict-volatile-bitfields'
clang: error: -Wl,-EL: 'linker' input unused [-Werror,-Wunused-command-line-argument]
make[2]: *** [src/Debug.cpp.d] Error 1
make[1]: *** [Storage-build] Error 2
make: *** [all] Error 2

@mikee47
Copy link
Contributor

mikee47 commented Jun 7, 2024

So on your system running g++ invokes clang. I'm not an Apple user but from a quick web search I suspect clang/llvm is the default installed toolset.

Sming requires GCC. Have a look at https://sming.readthedocs.io/en/latest/getting-started/macos/index.html for installation instructions. You can also try searching for 'installing gcc on macos`.

It would be handy to have a MacOS system for testing, but they don't make it easy!

@mtzfactory
Copy link
Author

You are right, I tried to install the GNU version but still doesn't work...

As you can see I have installed the GNU versions for make and gcc...

❯ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0
❯ gcc --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
❯ $(brew --prefix gcc)/bin/gcc-14 --version
gcc-14 (Homebrew GCC 14.1.0) 14.1.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

❯ $(brew --prefix gcc)/bin/g++-14 --version
g++-14 (Homebrew GCC 14.1.0) 14.1.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

And I set the env variables to define the right CC and GCC:

# make
  local MAKE="$BREW_OPT_DIR/make"
  [ -d "$MAKE" ] && export PATH="$MAKE/libexec/gnubin:$PATH"

  # gcc
  local GCC="$BREW_OPT_DIR/gcc"
  if [ -d "$GCC" ]; then
    export PATH="$GCC/bin:$PATH"
    export CC="$(brew --prefix gcc)/bin/gcc-14"
    export CXX="$(brew --prefix gcc)/bin/g++-14"
  fi

I don't know what else I can do :-(

@mikee47
Copy link
Contributor

mikee47 commented Jun 11, 2024

I'm trying to get a VM installation of MacOS so I can help further. It's painful...

In the meantime, you can edit Sming/Host/build.mk to set the paths explicitly. You'll see that Sming expects gcc and g++, etc. on the path (not CC or CXX).

slaff pushed a commit that referenced this issue Jun 12, 2024
This PR adds the `CLANG_BUILD` for host builds. The toolchain detection logic is in the main build.mk file as there might be future support for clang toolchains for actual devices. It's also a revision to the existing logic which checks GCC compiler version.

Try it out using `make SMING_SOC=host CLANG_BUILD=1`.
To build with a specific (installed) version of clang, for example clang-15, use `CLANG_BUILD=15` .
Further customisation can be made by editing `Sming/Arch/Host/build.mk`.

Clang-tidy support (#2648) is also improved as there are some compiler flag differences between GCC and clang which are now shared between CLANG_TIDY and CLANG_BUILD operation.

An extra CI build has been added using clang.

Further to #2773, the default toolchain for macos is a version of clang (Apple Clang). This PR doesn't quite support that because there are other issues to address, but it's a step in the right direction.
@mikee47
Copy link
Contributor

mikee47 commented Jun 12, 2024

Update, I've been trying to get host builds for MacOS but even with GCC installed we still have to use the xcode linker. Bear with me, I'm sure we can get this working!

@mikee47
Copy link
Contributor

mikee47 commented Jun 12, 2024

Spoke too soon.

The host emulator builds in 32-bit mode to reflect the devices being targeted. GCC and clang both allow building 32-bit binaries for 64-bit platforms. However, it looks like Apple won't support 32-bit applications at all. See https://support.apple.com/en-us/103076.

Build fails at the link step because the linker refuses to recognise code compiled with the -m32 option.

Revising the framework to support 64-bit builds is problematic because all pointers would become 64-bit. That could be worth investigating if only to allow more general use of the libraries.

@mikee47 mikee47 mentioned this issue Jun 16, 2024
9 tasks
slaff pushed a commit that referenced this issue Jun 24, 2024
This PR adds support for the Host Emulator to MacOS.

See #2773.

**64-bit only**

Standard compiler is 'Apple Clang', supports only 64-bit builds: no 32-bit compatibility.
GCC can be installed via `brew install gcc` and compiles as usual with the `-m32` flag.
The GNU linker is absent from brew's `coreutils` package (see Homebrew/homebrew-core#17794) so the standard system linker must be used. This only supports 64-bit targets.
Apple have removed 32-bit application support from their ecosystem.

Advantages
    No need for 32-bit compatibibility libraries in GNU/Linux.
    For MacOS build and run host emulator using standard Apple tools, no GCC required.
    General improvements in portability, less tolerant of incorrect type usage.

Disadvantages
    Types such as long, size_t now 64-bit, don't match target hardware
    Pointers are 64-bit so cannot be cast to 32-bit intrinsics. Code must use correct `intptr_t` types.
    Must use `ENABLE_STORAGE_SIZE64=1` as emulated flash addresses must be 64-bit.

**Symbol wrapping**

MacOS linker doesn't support symbol wrapping which is used by `malloc_count` Component to hook `malloc`, etc.
Don't currently have a solution for this so malloc_count is disabled for MacOS.

**CI builds**

Added MacOS builds plus running tests. For esp32 only IDF 5.2 is tested.

**Notes**

MacOS identified in makefiles with `UNAME=Darwin`.
In code, use `#ifdef __APPLE__` when running on apple toolchains.
Also requires `#ifdef __aarch64__` for Apple Silicon.
The `rbpf` library requires `bpf` target with clang. Not supported by apple clang - use brew clang.

I managed to get MacOS Ventura running in Qemu via https://github.com/kholia/OSX-KVM.
This runs in x86_64 mode, adequate for dev/testing.
The github actions runner `macos-latest` uses arm64, so introduces a few extra quirks.


**Tools**

- Compiler. Standard compiler is 'Apple Clang', supports only 64-bit builds: no 32-bit compatibility. Doesn't support `alias` attribute so use linker to do that instead.

- Archive. Standard `ar` does not support

- Linker. GNU Linker not available. MacOS linker does not support symbol wrapping.

- GDB. Can be installed with `brew` but requires some additional steps for security reasons. Separate `lldb` target added.

- sed. GNU 'sed' tool has extensions which MacOS version does not support. Added `SED` build variable which should always point to GNU version `gsed`, but only for Darwin.
@mikee47
Copy link
Contributor

mikee47 commented Jul 4, 2024

@mtzfactory With latest develop you should now be able to progress with Host builds.

@mikee47 mikee47 closed this as completed Jul 4, 2024
@mtzfactory
Copy link
Author

mtzfactory commented Jul 28, 2024

@mikee47 thanks for your efforts in solving this...
Good news is the initial clang errors disappeared but for some reason the linker is failing now:

$ make V=1
PYTHON_VERSION = Python 3.12.4
Note: Building with Apple-clang 15.0.0.

Basic_Blink: Invoking 'all' for Host (debug) architecture
-- Parsing App
-- Parsing Sming
-- Parsing Storage
-- Parsing sming-arch
-- Parsing driver
-- Parsing arch_driver
-- Parsing SerialLib
-- Parsing esp_hal
-- Parsing gdbstub
-- Parsing heap
-- Parsing hostlib
-- Parsing libc
-- Parsing spi_flash
-- Parsing vflash
-- Parsing rboot
-- Parsing FlashString
-- Parsing Spiffs
-- Parsing IFS
-- Parsing SPI
-- Parsing terminal
SUBMODULES_FETCHED:
/Applications/Xcode.app/Contents/Developer/usr/bin/make components application
PYTHON_VERSION = Python 3.12.4
Note: Building with Apple-clang 15.0.0.
-- Parsing App
-- Parsing Sming
-- Parsing Storage
-- Parsing sming-arch
-- Parsing driver
-- Parsing arch_driver
-- Parsing SerialLib
-- Parsing esp_hal
-- Parsing gdbstub
-- Parsing heap
-- Parsing hostlib
-- Parsing libc
-- Parsing spi_flash
-- Parsing vflash
-- Parsing rboot
-- Parsing FlashString
-- Parsing Spiffs
-- Parsing IFS
-- Parsing SPI
-- Parsing terminal

Building /opt/sming/samples/Basic_Blink/out/Host/debug/lib/clib-App-4cd15fee126d2cfd58677a9b32b80d61.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -r -R --no-print-directory -C out/Host/debug/build/App/App-4cd15fee126d2cfd58677a9b32b80d61 -f /opt/sming/Sming/component-wrapper.mk COMPONENT_NAME=App COMPONENT_PATH=/opt/sming/samples/Basic_Blink COMPONENT_BUILD_BASE=out/Host/debug/build/App COMPONENT_LIBDIR=/opt/sming/samples/Basic_Blink/out/Host/debug/lib COMPONENT_LIBNAME=App COMPONENT_LIBHASH=4cd15fee126d2cfd58677a9b32b80d61  build
PYTHON_VERSION = Python 3.12.4
Note: Building with Apple-clang 15.0.0.
WriteConfig /opt/sming/samples/Basic_Blink/out/Host/debug/build/App/App-4cd15fee126d2cfd58677a9b32b80d61/build.cfg
make[2]: Nothing to be done for `build'.
touch -c "/opt/sming/samples/Basic_Blink/out/Host/debug/lib/clib-App-4cd15fee126d2cfd58677a9b32b80d61.a"
/Applications/Xcode.app/Contents/Developer/usr/bin/make --no-print-directory hwconfig-validate
PYTHON_VERSION = Python 3.12.4
Note: Building with Apple-clang 15.0.0.
-- Parsing App
-- Parsing Sming
-- Parsing Storage
-- Parsing sming-arch
-- Parsing driver
-- Parsing arch_driver
-- Parsing SerialLib
-- Parsing esp_hal
-- Parsing gdbstub
-- Parsing heap
-- Parsing hostlib
-- Parsing libc
-- Parsing spi_flash
-- Parsing vflash
-- Parsing rboot
-- Parsing FlashString
-- Parsing Spiffs
-- Parsing IFS
-- Parsing SPI
-- Parsing terminal
Validating hardware config 'standard'
SMING_HOME="/opt/sming/Sming" SMING_ARCH="Host" SMING_SOC="host" OUT_BASE="out/Host/debug" HWCONFIG_DIRS="/opt/sming/samples/Basic_Blink  /opt/sming/Sming/Arch/Host /opt/sming/Sming" HWCONFIG_OPTS="" HWCONFIG_BUILDSPECS=" /opt/sming/Sming/Libraries/Spiffs/build.json /opt/sming/Sming/Components/IFS/build.json" HWCONFIG_SCHEMA="/opt/sming/Sming/Components/Storage/schema.json" /opt/homebrew/opt/python@3/bin/python3 /opt/sming/Sming/Components/Storage/Tools/hwconfig/hwconfig.py validate standard -
SMING_HOME="/opt/sming/Sming" SMING_ARCH="Host" SMING_SOC="host" OUT_BASE="out/Host/debug" HWCONFIG_DIRS="/opt/sming/samples/Basic_Blink  /opt/sming/Sming/Arch/Host /opt/sming/Sming" HWCONFIG_OPTS="" HWCONFIG_BUILDSPECS=" /opt/sming/Sming/Libraries/Spiffs/build.json /opt/sming/Sming/Components/IFS/build.json" HWCONFIG_SCHEMA="/opt/sming/Sming/Components/Storage/schema.json" /opt/homebrew/opt/python@3/bin/python3 /opt/sming/Sming/Components/Storage/Tools/hwconfig/hwconfig.py partgen standard out/Host/debug/firmware/partitions.bin
Verifying partition table...
Writing to 'out/Host/debug/firmware/partitions.bin'
Basic_Blink: Linking out/Host/debug/firmware/app
WriteConfig out/Host/debug/firmware/app.cfg
g++ -Lout/Host/debug/lib -L/opt/sming/Sming/out/Host/debug/lib -Wl,-map,out/Host/debug/firmware/app.map -Wl,-w -Wl,-undefined,suppress -Wl,-flat_namespace   /opt/sming/Sming/out/Host/debug/lib/clib-Sming-334d12a2e9d6d3b9f6d2b2601bd6efea.a /opt/sming/Sming/out/Host/debug/lib/clib-Storage-05facba2c21a7ea5f46aa64d5ad116ec.a /opt/sming/Sming/out/Host/debug/lib/clib-sming-arch-d7260691270308fc79c91ae769e365bc.a /opt/sming/Sming/out/Host/debug/lib/clib-FlashString.a /opt/sming/Sming/out/Host/debug/lib/clib-Spiffs-a7045ecdb428dae983d689bef7e1fc4c.a /opt/sming/Sming/out/Host/debug/lib/clib-IFS-b42a2400b5492f2c1c38a4bc6e072e6a.a /opt/sming/Sming/out/Host/debug/lib/clib-SPI-384cc4776fd3bb8b6a07b0af0600efef.a /opt/sming/Sming/out/Host/debug/lib/clib-driver-b74d2cc119e8d2ea1d9c8827b431c60c.a /opt/sming/Sming/out/Host/debug/lib/clib-esp_hal-b74d2cc119e8d2ea1d9c8827b431c60c.a /opt/sming/Sming/out/Host/debug/lib/clib-gdbstub.a /opt/sming/Sming/out/Host/debug/lib/clib-heap-1b8ef5aea84d9cd64812b71273db9aef.a /opt/sming/Sming/out/Host/debug/lib/clib-hostlib-6dc5eb31a811240991e92117f65caa64.a /opt/sming/Sming/out/Host/debug/lib/clib-libc.a /opt/sming/Sming/out/Host/debug/lib/clib-spi_flash-d7260691270308fc79c91ae769e365bc.a /opt/sming/Sming/out/Host/debug/lib/clib-rboot-c11442c8e56dc48c11f45db0277f4cab.a /opt/sming/Sming/out/Host/debug/lib/clib-arch_driver.a /opt/sming/Sming/out/Host/debug/lib/clib-SerialLib.a /opt/sming/samples/Basic_Blink/out/Host/debug/lib/clib-App-4cd15fee126d2cfd58677a9b32b80d61.a -lpthread  -o out/Host/debug/firmware/app
ld: multiple errors: archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-Storage-05facba2c21a7ea5f46aa64d5ad116ec.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-FlashString.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-Sming-334d12a2e9d6d3b9f6d2b2601bd6efea.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-sming-arch-d7260691270308fc79c91ae769e365bc.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-heap-1b8ef5aea84d9cd64812b71273db9aef.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-hostlib-6dc5eb31a811240991e92117f65caa64.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-gdbstub.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-esp_hal-b74d2cc119e8d2ea1d9c8827b431c60c.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-spi_flash-d7260691270308fc79c91ae769e365bc.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-Spiffs-a7045ecdb428dae983d689bef7e1fc4c.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-SPI-384cc4776fd3bb8b6a07b0af0600efef.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-driver-b74d2cc119e8d2ea1d9c8827b431c60c.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-libc.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-rboot-c11442c8e56dc48c11f45db0277f4cab.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-SerialLib.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-arch_driver.a'; archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-IFS-b42a2400b5492f2c1c38a4bc6e072e6a.a'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [out/Host/debug/firmware/app] Error 1
make: *** [all] Error 2

@mikee47 mikee47 reopened this Jul 29, 2024
@mikee47
Copy link
Contributor

mikee47 commented Jul 29, 2024

@mikee47
Copy link
Contributor

mikee47 commented Jul 29, 2024

Can you try editing Sming/Arch/Host/build/mk and updating line 25:

AR := /usr/bin/ar

@mikee47
Copy link
Contributor

mikee47 commented Jul 29, 2024

or it might be line 34, maybe insert an override line 40.

@mikee47
Copy link
Contributor

mikee47 commented Jul 29, 2024

Re-formatting the errors more clearly:

ld: multiple errors:
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-Storage-05facba2c21a7ea5f46aa64d5ad116ec.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-FlashString.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-Sming-334d12a2e9d6d3b9f6d2b2601bd6efea.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-sming-arch-d7260691270308fc79c91ae769e365bc.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-heap-1b8ef5aea84d9cd64812b71273db9aef.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-hostlib-6dc5eb31a811240991e92117f65caa64.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-gdbstub.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-esp_hal-b74d2cc119e8d2ea1d9c8827b431c60c.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-spi_flash-d7260691270308fc79c91ae769e365bc.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-Spiffs-a7045ecdb428dae983d689bef7e1fc4c.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-SPI-384cc4776fd3bb8b6a07b0af0600efef.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-driver-b74d2cc119e8d2ea1d9c8827b431c60c.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-libc.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-rboot-c11442c8e56dc48c11f45db0277f4cab.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-SerialLib.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-arch_driver.a'
archive member '/' not a mach-o file in '/opt/sming/Sming/out/Host/debug/lib/clib-IFS-b42a2400b5492f2c1c38a4bc6e072e6a.a'

@mtzfactory
Copy link
Author

@mikee47 it worked! Overriding at line 40 worked! Thank you very much!

BTW: Now I'm able to debug with lldb and vscode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants