[PATCH] D118021: [Driver] Use libatomic for 32-bit SPARC atomics support

Rainer Orth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 10 02:53:21 PST 2022


ro marked an inline comment as done.
ro added inline comments.


================
Comment at: clang/test/Driver/solaris-ld.c:20
 // CHECK-LD-SPARC32-SAME: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD-SPARC32-SAME: "-zignore"
+// CHECK-LD-SPARC32-SAME: "-latomic"
----------------
MaskRay wrote:
> If they are consecutive.
The are, patch amended.


================
Comment at: clang/test/Driver/solaris-ld.c:46
 // CHECK-LD-SPARC64-SAME: "-L[[SYSROOT]]/usr/lib/sparcv9"
+// CHECK-LD-SPARC64-NOT:  "-zignore"
+// CHECK-LD-SPARC64-NOT:  "-latomic"
----------------
MaskRay wrote:
> Such NOT patterns are usually inadequate and may go stale pretty easily, since technically the patterns can occur in many places.
> 
> One idea is to use --implicit-check-not; another is to enumerate all options and use the `{{^}}` style I picked in linux-cross.cpp, but perhaps your style is good enough if we can remember these library after after -L and before -lgcc_s
> Such NOT patterns are usually inadequate and may go stale pretty easily, since technically the patterns can occur in many places.

I wondered so myself: while this is currently the only instance of `-zignore`/`-zrecord`, `-lgcc_s` requires similar treatment.

> One idea is to use --implicit-check-not; another is to enumerate all options and use the `{{^}}` style I picked in linux-cross.cpp, but perhaps your style is good enough if we can remember these library after after -L and before -lgcc_s

I'll check those.  However, it occured to me that the crucial check is that `-latomic` isn't added at all, `-zignore`/`-zrecord` or no, so maybe just check for that and avoid the issue for the moment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118021/new/

https://reviews.llvm.org/D118021



More information about the cfe-commits mailing list