Hi, tcc port on Apple M1 is not too bad as long as you accept it generates code for x86_64 which is then translated by rosetta.
That said, your problem is that tcc does not define __LITTLE_ENDIAN__ as gcc does jullien@mobley:~ $ tcc -dM -E - < /dev/null | grep END | sort #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __ORDER_BIG_ENDIAN__ 4321 #define __ORDER_LITTLE_ENDIAN__ 1234 jullien@mobley:~ $ gcc -dM -E - < /dev/null | grep END | sort #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __LITTLE_ENDIAN__ 1 #define __ORDER_BIG_ENDIAN__ 4321 #define __ORDER_LITTLE_ENDIAN__ 1234 #define __ORDER_PDP_ENDIAN__ 3412 You can see that __LITTLE_ENDIAN__ is missing for tcc I've just added this missing definition on mod, you can test it right now. C. -----Original Message----- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of david.k...@libertysurf.fr Sent: Tuesday, January 11, 2022 03:48 To: tinycc-devel@nongnu.org Subject: [Tinycc-devel] Re : Compile Libbtc for Apple M1 with tcc Hi, the M1 chip is an ARM64 processor, not a x86_64 one. Perhaps the ARM support of TCC is not up to par with its x86 counterpart. Good luck anyway. Regards. ----- Mail d'origine ----- De: Niklas Rosencrantz <nikla...@gmail.com> À: tinycc-devel@nongnu.org Envoyé: Mon, 10 Jan 2022 23:49:04 +0100 (CET) Objet: [Tinycc-devel] Compile Libbtc for Apple M1 with tcc Hello, Trying to compile Libbtc for Apple M1 with tcc. It worked with an Apple Intel machine and setting CC=tcc. Since tcc can build it on the Intel with macOS I try ask here if you might know the cause of the failure. With the Apple M1 the following message comes from make In file included from ./include/btc/serialize.h:34: In file included from ./include/btc/portable_endian.h:22: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h:314: error: #error Unknown endianess. make[1]: *** [src/tools/bitcointool-bitcointool.o] Error 1 Build Options: with ecmult precomp = yes with external callbacks = no with benchmarks = yes with tests = yes with openssl tests = no with coverage = no module ecdh = no module recovery = yes module extrakeys = no module schnorrsig = no asm = no ecmult window size = 15 ecmult gen prec. bits = 4 valgrind = no CC = tcc CFLAGS = -O2 -fvisibility=hidden -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings -W -g CPPFLAGS = -I/opt/homebrew/opt/valgrind/include LDFLAGS = CC_FOR_BUILD = tcc CFLAGS_FOR_BUILD = -O2 -fvisibility=hidden -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings -W -g CPPFLAGS_FOR_BUILD = -I/opt/homebrew/opt/valgrind/include LDFLAGS_FOR_BUILD = Options used to compile and link: with wallet = yes with tools = yes with net = yes target os = darwin CC = tcc CFLAGS = -g -O2 -W -std=gnu99 -pedantic -Wno-unused-function -Wno-long-long -Wno-overlength-strings -Werror=return-type CXX = CXXFLAGS = LDFLAGS = _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel