Comments (11)
Assembler on its own doesn't support C preprocesor directives like #include
. When you compile an assembly source file using GCC, there is an option to automatically run the source file through C preprocesor before passing it to the assembler. By default, GCC decides whether to do this or not based on the file extension. Assembly source files with .S
extension are passed through the preprocesor, source files with .s
extension are not. You can override this behavior using -x assembler-with-cpp
option.
from crosstool-ng.
Where should I set it? If I set it to "CT_EXTRA_CFLAGS_FOR_BUILD" or "CT_EXTRA_CFLAGS_FOR_HOST", I get a syntax error when compiling test.c.
Are there instructions for building xtensa-esp32s3-elf?
from crosstool-ng.
Could you please describe what you are trying to do? What is the contents of test.c? What command are you running to compile it?
from crosstool-ng.
Could you please describe what you are trying to do? What is the contents of test.c? What command are you running to compile it?
the contents of test.c
int main() { return 0; }
from crosstool-ng.
build options
if [ uname -o
== "Android" ]
then
config_value "$CT_CONFIG_FILE" "CT_CFLAGS_FOR_BUILD" "-I${PREFIX}/include -fPIE"
config_value "$CT_CONFIG_FILE" "CT_LDFLAGS_FOR_BUILD" "-L${PREFIX}/lib -fPIE -pie"
config_value "$CT_CONFIG_FILE" "CT_EXTRA_CFLAGS_FOR_BUILD" "-I${PREFIX}/include -fPIE"
config_value "$CT_CONFIG_FILE" "CT_EXTRA_LDFLAGS_FOR_BUILD" "-L${PREFIX}/lib -fPIE -pie"
config_value "$CT_CONFIG_FILE" "CT_EXTRA_CFLAGS_FOR_HOST" "-I${PREFIX}/include -fPIE"
config_value "$CT_CONFIG_FILE" "CT_EXTRA_LDFLAGS_FOR_HOST" "-L${PREFIX}/lib -fPIE -pie"
config_append "$CT_CONFIG_FILE" ".*_EXTRA_CONFIG_ARRAY" "\2 --with-gnu-ld --disable-__cxa_atexit --without-headers"
fi
config_value "$CT_CONFIG_FILE" "CT_HOST" "$CT_HOST"
config_value "$CT_CONFIG_FILE" "CT_BUILD" "$CT_BUILD"
config_value "$CT_CONFIG_FILE" "CT_WORK_DIR" "$CT_WORK_DIR"
config_value "$CT_CONFIG_FILE" "CT_BUILD_TOP_DIR" "${CT_WORK_DIR}/${CT_TARGET}"
config_value "$CT_CONFIG_FILE" "CT_SRC_DIR" "${CT_BUILD_TOP_DIR}/src"
config_enable "$CT_CONFIG_FILE" "CT_DEBUG_CT_SAVE_STEPS"
config_append "$CT_CONFIG_FILE" ".*_EXTRA_CONFIG_ARRAY" "\2 --disable-bootstrap --disable-werror"
config_append "$CT_CONFIG_FILE" "CT_EXTRA_CFLAGS_FOR_BUILD" "\2 -x assembler-with-cpp"
config_append "$CT_CONFIG_FILE" "CT_EXTRA_CFLAGS_FOR_HOST" "\2 -x assembler-with-cpp"
config_enable "$CT_CONFIG_FILE" "CT_EXPERIMENTAL"
config_enable "$CT_CONFIG_FILE" "CT_ALLOW_BUILD_AS_ROOT"
config_enable "$CT_CONFIG_FILE" "CT_ALLOW_BUILD_AS_ROOT_SURE"
}
from crosstool-ng.
Even if the -x assembler-with-cpp option is specified, an error occurs.
cd crosstool-NG/
.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/build
/build-cc-gcc-core/xtensa-esp32s3-elf/libgcc
make
# If this is the top-level multilib, build all the other
# multilibs.
make[1]: Entering directory '/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/build/build-cc-gcc-core/xtensa-esp32s3-elf/libgcc'
make[2]: Entering directory '/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/build/build-cc-gcc-core/xtensa-esp32s3-elf/esp32-psram/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/build/build-cc-gcc-core/./gcc/xgcc -B/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/build/build-cc-gcc-core/./gcc/ -B/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/buildtools/xtensa-esp32s3-elf/bin/ -B/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/buildtools/xtensa-esp32s3-elf/lib/ -isystem /data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/buildtools/xtensa-esp32s3-elf/include -isystem /data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/buildtools/xtensa-esp32s3-elf/sys-include -g -O2 -mlongcalls -idirafter /data/data/com.termux/files/home/git/crosstool-NG/builds/xtensa-esp32s3-elf/xtensa-esp32s3-elf/include -g -Os -x assembler-with-cpp -mfix-esp32-psram-cache-issue -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -mlongcalls -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -mlongcalls -I. -I. -I../../.././gcc -I/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/src/gcc/libgcc -I/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/src/gcc/libgcc/. -I/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/src/gcc/libgcc/../gcc -I/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/src/gcc/libgcc/../include -DHAVE_CC_TLS -x assembler-with-cpp -o _addsubsf3_s.o -MT _addsubsf3_s.o -MD -MP -MF _addsubsf3_s.dep -DSHARED -DL_addsubsf3 -xassembler-with-cpp -c /data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/src/gcc/libgcc/config/xtensa/lib1funcs.S
/data/data/com.termux/files/usr/tmp/ccoYgST1.s: Assembler messages:
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:18: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:28: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:34: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:52: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:62: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:74: Error: unknown opcode or format name 'leaf_entry'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:148: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:190: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:203: Error: unknown opcode or format name 'leaf_return'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:214: Error: unknown opcode or format name 'do_nsau'
/data/data/com.termux/files/usr/tmp/ccoYgST1.s:239: Error: unknown opcode or format name 'leaf_return'
make[2]: *** [Makefile:491: _addsubsf3_s.o] Error 1
make[2]: Leaving directory '/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/build/build-cc-gcc-core/xtensa-esp32s3-elf/esp32-psram/libgcc'
make[1]: *** [Makefile:1211: multi-do] Error 1
make[1]: Leaving directory '/data/data/com.termux/files/home/git/crosstool-NG/.build-xtensa-esp32s3-elf/xtensa-esp32s3-elf/build/build-cc-gcc-core/xtensa-esp32s3-elf/libgcc'
make: *** [Makefile:127: all-multi] Error 2
from crosstool-ng.
After removing -DL_addsubsf3, the compilation went through.
from crosstool-ng.
Macro definition in lib1funcs.S doesn't seem to work
from crosstool-ng.
It seems that the macro is not visible in #include "ieee754-sf.S".
from crosstool-ng.
If the file has a large number of characters, it seems to cause a macro undefined error. Is there a limit to the buffer size?
from crosstool-ng.
Related Issues (20)
- `make install` fails by undefined symbol errors. HOT 1
- support for arm64-apple-macosx13.0.0 binaries HOT 2
- Generate latest toolchain for ESP8266 - why was support dropped as of 2020r3? HOT 5
- Please upload esp-12.2.0 to platformio registry HOT 26
- Add 8.4.0+2021r2-patch3 back to PlatformIO registry HOT 1
- esp-12.2.0_20230208 missing gdb HOT 4
- git clone modules not found `esp-toolchain-bin-wrappers`and `xtensa-dynconfig` HOT 3
- xtensa-esp32s2-elf-gcc: internal compiler error: Segmentation fault signal terminated program cc1 HOT 2
- GH Actions Build HOT 3
- Support for C++20 ranges HOT 7
- fatal error: type_traits: No such file or directory HOT 2
- xtensa-esp-elf: how to influence endianness ? HOT 4
- 我使用Arduion编译Esp32项目时出错,换用2.0.11\2.0.12\2.0.14\3.0.0 Alpha版本的库和多个IDE版本均报错"\bits\allocator.h:46:10: fatal error: bits/c++allocator.h: No such file or directory" HOT 2
- xtensa: Size optimization regression between GCC 8.4.0 and 13.2.0 HOT 21
- Build error on google colab HOT 1
- Possible bug in xtensa-esp32-elf-g++ (crosstool-NG esp-2021r2-patch5) 8.4.0 HOT 9
- Update platformio toolchain package registry with latest releases HOT 1
- gold / lld support for parallel linking HOT 9
- Linker from esp-13.2.0-20230928 cannot locate objects or libraries that are specified with absolute paths HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crosstool-ng.