[ATfL] Restore the use of -DLLVM_ENABLE_LIBCXX=ON in build.sh #370
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently we removed -DLLVM_ENABLE_LIBCXX=ON from build.sh to prevent compiler warnings and sudden relocation errors at the link time.
This move was not justified properly. With removal of this setting, there is no CMake-level governance and reassurance that the LLVM's libc++ is astually being used as the C++ standard library. Currently we are ensuring that by using the -stdlib++-isystem flag fed directly to the compiler flags, along with -stdlib=libc++ fed directly to the linker flags. Although this is the right thing to do, it does not effect in a proper awareness at CMake level that libc++ is being used.
An observation has been made that restoring -DLLVM_ENABLE_LIBCXX=ON with current set of compiler flags results in CMake dropping the use of -fPIC from the compiler invocations, this happens despide our explicit use of -DLLVM_ENABLE_PIC=ON. As a result, the following relocation error is occuring at the link time:
To address it, this patch adds explicit use of the -fPIC flag to the compiler flags.