Compare commits

...
2 Commits
Author SHA1 Message Date
Rui Ueyama bda68f94a4 Bump mold version to 1.0.3 2022-01-30 19:39:38 +09:00
Rui Ueyama 601b9e691c Fix build-static.sh script
`build-static.sh` didn't create a statically-linked binary.

Fixes https://github.com/rui314/mold/issues/315
2022-01-30 18:21:02 +09:00
3 changed files with 7 additions and 8 deletions

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ CFLAGS = -O2
CXXFLAGS = -O2
MOLD_CXXFLAGS = -std=c++20 -fno-exceptions -fno-unwind-tables \
-fno-asynchronous-unwind-tables -DMOLD_VERSION=\"1.0.2\" \
-fno-asynchronous-unwind-tables -DMOLD_VERSION=\"1.0.3\" \
-DLIBDIR="\"$(LIBDIR)\""
MOLD_LDFLAGS = -pthread -lz -lm
+1 -1
View File
@@ -72,7 +72,7 @@ sudo dnf install -y git clang cmake openssl-devel xxhash-devel zlib-devel libstd
```shell
git clone https://github.com/rui314/mold.git
cd mold
git checkout v1.0.2
git checkout v1.0.3
make -j$(nproc) CXX=clang++
sudo make install
```
+5 -6
View File
@@ -24,15 +24,15 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*
EOF
EXTRA_LDFLAGS='-fuse-ld=lld -static'
LDFLAGS='-fuse-ld=lld -static'
# libstdc++'s `std::__glibcxx_rwlock_rdlock` refers these symbols
# as weak symbols, although they need to be defined. Otherwise,
# the program crashes after juping to address 0.
# So, we force loading symbols as a workaround.
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-u,pthread_rwlock_rdlock"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-u,pthread_rwlock_unlock"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-u,pthread_rwlock_wrlock"
LDFLAGS="$LDFLAGS -Wl,-u,pthread_rwlock_rdlock"
LDFLAGS="$LDFLAGS -Wl,-u,pthread_rwlock_unlock"
LDFLAGS="$LDFLAGS -Wl,-u,pthread_rwlock_wrlock"
docker_args=(-v "`pwd`:/mold:Z" -u "$(id -u)":"$(id -g)")
if docker --version | grep -q podman; then
@@ -41,5 +41,4 @@ fi
docker run -it --rm "${docker_args[@]}" \
mold-build-ubuntu20 \
make -C /mold -j"$(nproc)" CC=clang CXX=clang++ \
EXTRA_LDFLAGS="$EXTRA_LDFLAGS" "$@"
make -C /mold -j"$(nproc)" CC=clang CXX=clang++ LDFLAGS="$LDFLAGS" "$@"