================
@@ -143,6 +143,20 @@
 // RUN:   | FileCheck %s --check-prefix=CHECK-RTLIB-GCC
 // CHECK-RTLIB-GCC: -lgcc
 
+// RUN: %clang -### --target=arm-none-eabi -nolibc %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-NOLIBC
+// CHECK-NOLIBC-NOT: "-lc"
+// CHECK-NOLIBC-NOT: "-lm"
+// CHECK-NOLIBC-NOT: "-lc++"
+// CHECK-NOLIBC: "{{[^"]*}}libclang_rt.builtins.a"
----------------
saturn691 wrote:

The thing I'm trying to test is the follows, I think it _still_ makes sense to 
test `libclang_rt.builtings.a`:

-nolibc
Do not use the C library or system libraries tightly coupled with it when 
linking. **Still link with the startup files, libgcc** or toolchain provided 
language support libraries such as libgnat, libgfortran or libstdc++ unless 
options preventing their inclusion are used as well.


-nostdlib
Do not use the standard system startup files or libraries when linking. No 
startup files and only the libraries you specify are passed to the linker, and 
options specifying linkage of the system libraries, such as -static-libgcc or 
-shared-libgcc, are ignored.

The compiler may generate calls to memcmp, memset, memcpy and memmove. These 
entries are usually resolved by entries in libc. These entry points should be 
supplied through some other mechanism when this option is specified.

**One of the standard libraries bypassed by -nostdlib and -nodefaultlibs is 
libgcc.a**, a library of internal subroutines which GCC uses to overcome 
shortcomings of particular machines, or special needs for some languages. 

https://github.com/llvm/llvm-project/pull/145700
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to