diff options
author | John Ericson <git@JohnEricson.me> | 2019-10-07 23:06:26 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-12 06:32:18 -0400 |
commit | c2290596f10ce732be85503d3ef0f0b50b7e925a (patch) | |
tree | 7206d141fd205c0c6fe6a0d54eb30f1171b23f06 /rts | |
parent | 166e1c2adf73b69bfbbec81e98a78814a031ddc7 (diff) | |
download | haskell-c2290596f10ce732be85503d3ef0f0b50b7e925a.tar.gz |
Simplify Configure in a few ways
- No need to distinguish between gcc-llvm and clang. First of all,
gcc-llvm is quite old and surely unmaintained by now. Second of all,
none of the code actually care about that distinction!
Now, it does make sense to consider C multiple frontends for LLVMs in
the form of clang vs clang-cl (same clang, yes, but tweaked
interface). But this is better handled in terms of "gccish vs
mvscish" and "is LLVM", yielding 4 combinations. Therefore, I don't
think it is useful saving the existing code for that.
- Get the remaining CC_LLVM_BACKEND, and also TABLES_NEXT_TO_CODE in
mk/config.h the normal way, rather than hacking it post-hoc. No point
keeping these special cases around for now reason.
- Get rid of hand-rolled `die` function and just use `AC_MSG_ERROR`.
- Abstract check + flag override for unregisterised and tables next to
code.
Oh, and as part of the above I also renamed/combined some variables
where it felt appropriate.
- GccIsClang -> CcLlvmBackend. This is for `AC_SUBST`, like the other
Camal case ones. It was never about gcc-llvm, or Apple's renamed clang,
to be clear.
- llvm_CC_FLAVOR -> CC_LLVM_BACKEND. This is for `AC_DEFINE`, like the
other all-caps snake case ones. llvm_CC_FLAVOR was just silly
indirection *and* an odd name to boot.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Task.h | 2 | ||||
-rw-r--r-- | rts/ghc.mk | 2 | ||||
-rw-r--r-- | rts/sm/GCTDecl.h | 6 | ||||
-rw-r--r-- | rts/sm/GCThread.h | 2 | ||||
-rw-r--r-- | rts/sm/Storage.c | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/rts/Task.h b/rts/Task.h index 88b567ab87..17bcbe2da4 100644 --- a/rts/Task.h +++ b/rts/Task.h @@ -271,7 +271,7 @@ extern uint32_t peakWorkerCount; #if ((defined(linux_HOST_OS) && \ (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH))) || \ (defined(mingw32_HOST_OS) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4)) && \ - (!defined(llvm_CC_FLAVOR)) + (!defined(CC_LLVM_BACKEND)) #define MYTASK_USE_TLV extern __thread Task *my_task; #else diff --git a/rts/ghc.mk b/rts/ghc.mk index 26865b5bb7..c07cfaec86 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -523,7 +523,7 @@ rts/win32/ThrIOManager_CC_OPTS += -w # for details # Without this, thread_obj will not be inlined (at least on x86 with GCC 4.1.0) -ifneq "$(CC_CLANG_BACKEND)" "1" +ifneq "$(CcLlvmBackend)" "YES" rts/sm/Compact_CC_OPTS += -finline-limit=2500 endif diff --git a/rts/sm/GCTDecl.h b/rts/sm/GCTDecl.h index 8306795ade..e740392c15 100644 --- a/rts/sm/GCTDecl.h +++ b/rts/sm/GCTDecl.h @@ -52,11 +52,11 @@ extern StgWord8 the_gc_thread[]; /* Now, llvm-gcc and some older Clang compilers do not support __thread. So we have to fallback to the extremely slow case, - unfortunately. Note: clang_CC_FLAVOR implies llvm_CC_FLAVOR. + unfortunately. Also, the iOS Clang compiler doesn't support __thread either for some bizarre reason, so there's not much we can do about that... */ -#if defined(llvm_CC_FLAVOR) && (CC_SUPPORTS_TLS == 0) +#if defined(CC_LLVM_BACKEND) && (CC_SUPPORTS_TLS == 0) #define gct ((gc_thread *)(pthread_getspecific(gctKey))) #define SET_GCT(to) (pthread_setspecific(gctKey, to)) #define DECLARE_GCT ThreadLocalKey gctKey; @@ -66,7 +66,7 @@ extern StgWord8 the_gc_thread[]; /* However, if we *are* using an LLVM based compiler with __thread support, then use that (since LLVM doesn't support global register variables.) */ -#elif defined(llvm_CC_FLAVOR) && (CC_SUPPORTS_TLS == 1) +#elif defined(CC_LLVM_BACKEND) && (CC_SUPPORTS_TLS == 1) extern __thread gc_thread* gct; #define SET_GCT(to) gct = (to) #define DECLARE_GCT __thread gc_thread* gct; diff --git a/rts/sm/GCThread.h b/rts/sm/GCThread.h index 66f604d6cc..66f7a7f84f 100644 --- a/rts/sm/GCThread.h +++ b/rts/sm/GCThread.h @@ -208,7 +208,7 @@ extern uint32_t n_gc_threads; extern gc_thread **gc_threads; -#if defined(THREADED_RTS) && defined(llvm_CC_FLAVOR) +#if defined(THREADED_RTS) && defined(CC_LLVM_BACKEND) extern ThreadLocalKey gctKey; #endif diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index d4be531c73..0130a08f7c 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -271,7 +271,7 @@ void storageAddCapabilities (uint32_t from, uint32_t to) } } -#if defined(THREADED_RTS) && defined(llvm_CC_FLAVOR) && (CC_SUPPORTS_TLS == 0) +#if defined(THREADED_RTS) && defined(CC_LLVM_BACKEND) && (CC_SUPPORTS_TLS == 0) newThreadLocalKey(&gctKey); #endif @@ -295,7 +295,7 @@ freeStorage (bool free_heap) closeMutex(&sm_mutex); #endif stgFree(nurseries); -#if defined(THREADED_RTS) && defined(llvm_CC_FLAVOR) && (CC_SUPPORTS_TLS == 0) +#if defined(THREADED_RTS) && defined(CC_LLVM_BACKEND) && (CC_SUPPORTS_TLS == 0) freeThreadLocalKey(&gctKey); #endif freeGcThreads(); |