Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Build fails on MacOS - gcc x clang flags conflict #41

@RyskAlTropic

Description

@RyskAlTropic

Hi,
build fails on MacOS platform.

(.venv) USER in ~/<PATH>libtropic-linux/TS1302_devkit/build on master λ make
[ 43%] Built target trezor_crypto
[ 45%] Extracting raw data from X25519 private key
[ 46%] Generating sh0_keys.c from DER files
[ 47%] Building C object libtropic/CMakeFiles/tropic.dir/hal/crypto/trezor_crypto/lt_crypto_trezor_aesgcm.c.o
error: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Werror,-Wunknown-warning-option]
make[2]: *** [libtropic/CMakeFiles/tropic.dir/hal/crypto/trezor_crypto/lt_crypto_trezor_aesgcm.c.o] Error 1
make[1]: *** [libtropic/CM

Root Cause

-Wlogical-op
GCC-specific warning flag that warns about suspicious uses of logical operators in expressions.
Apple clang (version 17.0.0) doesn't support -Wlogical-op. It's a GCC-only flag.

The flag is set in libtropic-linux/libtropic/cmake/strict_compile_flags.cmake (line 24), which is used when strict compilation flags are enabled. With -Werror (line 16), unknown warning flags become errors, so the build fails.

Why This Happens
The libtropic CMake build uses strict compile flags that include -Wlogical-op.
On macOS with Apple clang, this flag is unknown. With -Werror, the unknown flag triggers an error.

After commenting problematic flags in libtropic/cmake (-Werror, Wlogical-op):

<PATH>/libtropic-linux/TS1302_devkit/../libtropic/hal/port/unix/libtropic_port_unix_usb_dongle.h:12:10: fatal error: 'linux/gpio.h' file not found
   12 | #include <linux/gpio.h>
      |          ^~~~~~~~~~~~~~
4 warnings and 1 error generated.
make[2]: *** [CMakeFiles/lt_ex_show_chip_id_and_fwver.dir/src/main.c.o] Error 1
make[1]: *** [CMakeFiles/lt_ex_show_chip_id_and_fwver.dir/all] Error 2
make: *** [all] Error 2

So I guess this would need further investigation than simple resolve problematic flags.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions