summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/arm11/gnu/example_build/build_threadx_sample.bat2
-rw-r--r--ports/arm9/gnu/example_build/build_threadx_sample.bat2
-rw-r--r--ports/cortex_r4/gnu/example_build/build_threadx_sample.bat2
-rwxr-xr-xports/cortex_r4/gnu/example_build/build_threadx_sample.sh2
-rw-r--r--ports/cortex_r5/gnu/example_build/build_threadx_sample.bat2
-rwxr-xr-xports/cortex_r5/gnu/example_build/build_threadx_sample.sh2
-rwxr-xr-xscripts/check_clang.sh19
7 files changed, 18 insertions, 13 deletions
diff --git a/ports/arm11/gnu/example_build/build_threadx_sample.bat b/ports/arm11/gnu/example_build/build_threadx_sample.bat
index e67e3c20..1515eb27 100644
--- a/ports/arm11/gnu/example_build/build_threadx_sample.bat
+++ b/ports/arm11/gnu/example_build/build_threadx_sample.bat
@@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=arm1136j-s reset.S
arm-none-eabi-gcc -c -g -mcpu=arm1136j-s crt0.S
arm-none-eabi-gcc -c -g -mcpu=arm1136j-s tx_initialize_low_level.S
arm-none-eabi-gcc -c -g -mcpu=arm1136j-s -I../../../../common/inc -I../inc sample_threadx.c
-arm-none-eabi-ld -A arm1136j-s -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libnosys.a libgcc.a -o sample_threadx.out -M > sample_threadx.map
+arm-none-eabi-gcc -g -nostartfiles -mcpu=arm1136j-s -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a
diff --git a/ports/arm9/gnu/example_build/build_threadx_sample.bat b/ports/arm9/gnu/example_build/build_threadx_sample.bat
index c35d2bc6..5c9347f4 100644
--- a/ports/arm9/gnu/example_build/build_threadx_sample.bat
+++ b/ports/arm9/gnu/example_build/build_threadx_sample.bat
@@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=arm9 reset.S
arm-none-eabi-gcc -c -g -mcpu=arm9 crt0.S
arm-none-eabi-gcc -c -g -mcpu=arm9 tx_initialize_low_level.S
arm-none-eabi-gcc -c -g -mcpu=arm9 -I../../../../common/inc -I../inc sample_threadx.c
-arm-none-eabi-ld -A arm9 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map
+arm-none-eabi-gcc -g -nostartfiles -mcpu=arm9 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a
diff --git a/ports/cortex_r4/gnu/example_build/build_threadx_sample.bat b/ports/cortex_r4/gnu/example_build/build_threadx_sample.bat
index 517b6d62..72444e4b 100644
--- a/ports/cortex_r4/gnu/example_build/build_threadx_sample.bat
+++ b/ports/cortex_r4/gnu/example_build/build_threadx_sample.bat
@@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-r4 reset.S
arm-none-eabi-gcc -c -g -mcpu=cortex-r4 crt0.S
arm-none-eabi-gcc -c -g -mcpu=cortex-r4 tx_initialize_low_level.S
arm-none-eabi-gcc -c -g -mcpu=cortex-r4 -I../../../../common/inc -I../inc sample_threadx.c
-arm-none-eabi-ld -A cortex-r4 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map
+arm-none-eabi-gcc -g -nostartfiles -mcpu=cortex-r4 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a
diff --git a/ports/cortex_r4/gnu/example_build/build_threadx_sample.sh b/ports/cortex_r4/gnu/example_build/build_threadx_sample.sh
index 0d8dbcd5..1f0e2709 100755
--- a/ports/cortex_r4/gnu/example_build/build_threadx_sample.sh
+++ b/ports/cortex_r4/gnu/example_build/build_threadx_sample.sh
@@ -61,5 +61,5 @@ esac
"${CC}" ${TARGET_FLAGS} -c -g -mcpu=cortex-r4 crt0.S
"${CC}" ${TARGET_FLAGS} -c -g -mcpu=cortex-r4 tx_initialize_low_level.S
"${CC}" ${TARGET_FLAGS} -c -g -mcpu=cortex-r4 -I../../../../common/inc -I../inc sample_threadx.c
-arm-none-eabi-ld -A cortex-r4 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map
+"${CC}" ${TARGET_FLAGS} -g -nostartfiles -mcpu=cortex-r4 -T sample_threadx.ld ${SYSCALL_LIB} -o sample_threadx.out -Wl,-Map=sample_threadx.map reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a
diff --git a/ports/cortex_r5/gnu/example_build/build_threadx_sample.bat b/ports/cortex_r5/gnu/example_build/build_threadx_sample.bat
index 2ded427d..f2de17cd 100644
--- a/ports/cortex_r5/gnu/example_build/build_threadx_sample.bat
+++ b/ports/cortex_r5/gnu/example_build/build_threadx_sample.bat
@@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-r5 reset.S
arm-none-eabi-gcc -c -g -mcpu=cortex-r5 crt0.S
arm-none-eabi-gcc -c -g -mcpu=cortex-r5 tx_initialize_low_level.S
arm-none-eabi-gcc -c -g -mcpu=cortex-r5 -I../../../../common/inc -I../inc sample_threadx.c
-arm-none-eabi-ld -A cortex-r5 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map
+arm-none-eabi-gcc -g -nostartfiles -mcpu=cortex-r5 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a
diff --git a/ports/cortex_r5/gnu/example_build/build_threadx_sample.sh b/ports/cortex_r5/gnu/example_build/build_threadx_sample.sh
index e3e133d6..2b3e4d55 100755
--- a/ports/cortex_r5/gnu/example_build/build_threadx_sample.sh
+++ b/ports/cortex_r5/gnu/example_build/build_threadx_sample.sh
@@ -61,5 +61,5 @@ esac
"${CC}" ${TARGET_FLAGS} -c -g -mcpu=cortex-r5 crt0.S
"${CC}" ${TARGET_FLAGS} -c -g -mcpu=cortex-r5 tx_initialize_low_level.S
"${CC}" ${TARGET_FLAGS} -c -g -mcpu=cortex-r5 -I../../../../common/inc -I../inc sample_threadx.c
-arm-none-eabi-ld -A cortex-r5 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map
+"${CC}" ${TARGET_FLAGS} -g -nostartfiles -mcpu=cortex-r5 -T sample_threadx.ld ${SYSCALL_LIB} -o sample_threadx.out -Wl,-Map=sample_threadx.map reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a
diff --git a/scripts/check_clang.sh b/scripts/check_clang.sh
index 3c4faee3..5f13c491 100755
--- a/scripts/check_clang.sh
+++ b/scripts/check_clang.sh
@@ -188,13 +188,18 @@ CMAKE_EXAMPLE_CORES="cortex_r52"
# their port directory, which covers both ports/ and ports_smp/. Listed
# explicitly rather than silently skipped, so the gaps stay visible.
#
-# These fail with the GNU toolchain too, so they are not LLVM problems:
-# arm9 arm11 their linker scripts do not define _init and _fini.
-# Those symbols come from crti.o and crtn.o, which
-# -nostartfiles leaves out, so newlib's fini.c fails to
-# link. Reproduced with arm-none-eabi-gcc 13.2.1.
-# cortex_r4 cortex_r5 need newlib multilib variants for those CPUs, which are
-# not present in every GNU toolchain packaging.
+# These fail with the GNU toolchain too, so they are not LLVM problems. All four
+# fail the same way, for the same reason:
+#
+# their linker scripts define the .init and .fini sections but not the _init
+# and _fini symbols. Those come from crti.o and crtn.o, which -nostartfiles
+# leaves out, so newlib's fini.c cannot resolve them and the link ends with
+# "undefined reference to `_fini'". Reproduced with arm-none-eabi-gcc 13.2.1.
+#
+# Until 6.1.10 the four linked libc.a and libgcc.a checked in beside them, which
+# supplied those symbols. That sweep removed the archives without updating the
+# link lines, so for years the examples failed earlier still, on the missing
+# files themselves. Fixing the link lines exposed the _fini gap underneath.
EXAMPLES_EXPECTED_TO_FAIL="arm9 arm11 cortex_r4 cortex_r5"
failures=0