Similar to D116843 for Gnu.cpp
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm ambivalent about this change. To me, it falls into the category of "stop passing random ld options to the compiler driver".
It's not only about options, but also some crt files. Very few projects assume the behavior and for the few, not implying -nostdlib for -r will cause them some portability inconvenience.
Well, you maintain the NetBSD part and can certainly disagree :)
Well, it doesn't work with GCC either, that's why I don't care much about this change. It just attempts to legalize a user bug (using a linker option directly as a compiler flag). But I don't care enough to object either.
-r is different from -Wl,-r.
GCC is free to assign specific semantics to -r, like -no-pie, -pie, -shared, to alter crt files and -l libraries a bit.
clang/test/Driver/netbsd.c | ||
---|---|---|
477 | Hi, I see this CHECK-NOT fail every now and then due to bad luck: 13:48:46 /repo/bbiswjenk/fem2s10-eiffel176/workspace/llvm/llvm-main-gcc/clang/test/Driver/netbsd.c:477:21: error: RELOCATABLE-NOT: excluded string found in input Same thing with 13:59:16 Failed Tests (5): Perhaps the CHECK-NOT can be made stricter to avoid these matches due to bad luck? |
Hi,
I see this CHECK-NOT fail every now and then due to bad luck:
13:48:46 /repo/bbiswjenk/fem2s10-eiffel176/workspace/llvm/llvm-main-gcc/clang/test/Driver/netbsd.c:477:21: error: RELOCATABLE-NOT: excluded string found in input
13:48:46 // RELOCATABLE-NOT: crt{{[^.]+}}.o
13:48:46 ^
13:48:46 <stdin>:6:286: note: found here
13:48:46 "/proj/bbi_twh/wh_bbi/x86_64-Linux2/bbigcc/1.9.3.0/crosscompiler/bin/ld" "--sysroot=/repo/bbiswjenk/fem2s10-eiffel176/workspace/llvm/llvm-main-gcc/clang/test/Driver/Inputs/basic_netbsd_tree" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" "-o" "a.out" "-r" "-r" "/tmp/lit-tmp-crtcq7cs/netbsd-94b421.o"
13:48:46 ^~~~~~~~~~~~~~~~~~~~~~~~
Same thing with
13:59:16 Failed Tests (5):
13:59:16 Clang :: Driver/freebsd.c
13:59:16 Clang :: Driver/fuchsia.c
13:59:16 Clang :: Driver/linux-cross.cpp
13:59:16 Clang :: Driver/netbsd.c
13:59:16 Clang :: Driver/openbsd.c
Perhaps the CHECK-NOT can be made stricter to avoid these matches due to bad luck?