[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1a7a1e59 12/13: Use libc++ rather than libstd
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1a7a1e59 12/13: Use libc++ rather than libstdc++ with clang |
Date: |
Mon, 21 Nov 2022 17:29:19 -0500 (EST) |
branch: master
commit 1a7a1e59df80c40f3a54080ee0e72054e606533f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use libc++ rather than libstdc++ with clang
Using LLVM's compiler, standard library, and linker all together
provides a toolchain entirely distinct from gcc and its ld.
---
compiler_clang.make | 3 ++-
install_wx.sh | 4 ++--
install_wxpdfdoc.sh | 19 ++++++++++++++++---
install_xml_libraries.sh | 4 ++--
4 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/compiler_clang.make b/compiler_clang.make
index 55de40d2..6919d9f2 100644
--- a/compiler_clang.make
+++ b/compiler_clang.make
@@ -163,7 +163,7 @@ CFLAGS =
# C++ compiler flags.
-REQUIRED_CXXFLAGS = -std=c++20 $(CXX_WARNINGS) $(REQUIRED_COMPILER_FLAGS)
+REQUIRED_CXXFLAGS = -std=c++20 -stdlib=libc++ $(CXX_WARNINGS)
$(REQUIRED_COMPILER_FLAGS)
CXXFLAGS =
@@ -213,6 +213,7 @@ EXTRA_LDFLAGS :=
REQUIRED_LDFLAGS = \
-fuse-ld=lld \
-Wl,-Map,$@.map \
+ -stdlib=libc++ \
$(c_l_flags) \
$(addprefix -L , $(all_library_directories)) \
$(EXTRA_LDFLAGS) \
diff --git a/install_wx.sh b/install_wx.sh
index 90ea5623..7566c7d7 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -136,8 +136,8 @@ case "$LMI_COMPILER" in
CXX=clang++ \
CPPFLAGS="-I$prefix/include" \
CFLAGS="$wx_cc_flags $valid_math" \
- CXXFLAGS="$wx_cxx_flags $valid_math" \
- LDFLAGS="-L$exec_prefix/lib -fuse-ld=lld" \
+ CXXFLAGS="$wx_cxx_flags $valid_math -stdlib=libc++" \
+ LDFLAGS="-L$exec_prefix/lib -fuse-ld=lld -stdlib=libc++" \
;;
(*)
diff --git a/install_wxpdfdoc.sh b/install_wxpdfdoc.sh
index c0780b4c..253c0e1c 100755
--- a/install_wxpdfdoc.sh
+++ b/install_wxpdfdoc.sh
@@ -113,15 +113,28 @@ case "$LMI_COMPILER" in
;;
(clang)
+ # To use the LLVM linker, it seems necessary to specify it
+ # in $CXX (and ignore the resulting
+ # argument unused during compilation: '-fuse-ld=lld'
+ # warning). Otherwise, a command such as
+ # readelf --string-dump .comment
/opt/lmi/local/clang_x86_64-pc-linux-gnu/lib/libwxcode_gtk3u_pdfdoc-3.2.so
+ # will lack the expected
+ # Linker: Debian LLD
+ # comment, even though it is specified in $LDFLAGS, and
+ # even if LD is specified in any of the following ways:
+ # LD=clang++
+ # LD=ld.lld
+ # LD="clang++ -fuse-ld=lld -stdlib=libc++"
+
valid_math="-Woverriding-t-option -ffp-model=strict
-ffp-exception-behavior=ignore -Wno-overriding-t-option"
# 'config_options' must not be double-quoted
# shellcheck disable=SC2086
"$wxpdfdoc_dir"/configure $config_options \
CC=clang \
- CXX=clang++ \
+ CXX="clang++ -fuse-ld=lld -stdlib=libc++" \
CFLAGS="$wxpdfdoc_cc_flags $valid_math" \
- CXXFLAGS="$wxpdfdoc_cxx_flags $valid_math" \
- LDFLAGS="-fuse-ld=lld" \
+ CXXFLAGS="$wxpdfdoc_cxx_flags $valid_math -stdlib=libc++" \
+ LDFLAGS="-fuse-ld=lld -stdlib=libc++" \
;;
(*)
diff --git a/install_xml_libraries.sh b/install_xml_libraries.sh
index e21b7f9c..fa377b63 100755
--- a/install_xml_libraries.sh
+++ b/install_xml_libraries.sh
@@ -292,8 +292,8 @@ for lib in xmlwrapp; do
CC=clang \
CXX=clang++ \
CFLAGS="-g -O2 -fno-ms-extensions $valid_math" \
- CXXFLAGS="-g -O2 -fno-ms-extensions $valid_math" \
- LDFLAGS="-fuse-ld=lld" \
+ CXXFLAGS="-g -O2 -fno-ms-extensions $valid_math
-stdlib=libc++" \
+ LDFLAGS="-fuse-ld=lld -stdlib=libc++" \
$xmlwrapp_options || err=$?
;;
(*)
- [lmi-commits] [lmi] master updated (b8fcdb21 -> d3d0a775), Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 7c47d71b 03/13: Perform speed test for all toolchains, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 55f92d87 02/13: Record gcc version twelve pc-linux-gnu speed for commit 5a4fcaed7, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master c6528973 06/13: Specify all '*FLAGS' in one place, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 93e400db 10/13: Avoid literal '***' in a 'set -vx' script, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 8cb31fd7 01/13: Record gcc version eleven pc-linux-gnu speed for commit 5a4fcaed7, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 1a7a1e59 12/13: Use libc++ rather than libstdc++ with clang,
Greg Chicares <=
- [lmi-commits] [lmi] master b830f9a0 04/13: Record speed measurements, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 4b6b2b5c 05/13: Split long lines that will soon become longer, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master d6c7ec7a 08/13: Build and install libraries for all toolchains, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 1e6d03ee 09/13: Print log messages before and after building, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master d3d0a775 13/13: Record speed measurements, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master cc85ea5a 11/13: Build libraries with specified toolchain, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master a60c106c 07/13: Use clang's preprocessor, Greg Chicares, 2022/11/21