1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-05 09:07:10 +03:00
Commit Graph

231 Commits

Author SHA1 Message Date
Rui Ueyama
02c9fa82d4 [ELF] Ensure mold-warpper.so is linked against libdl 2022-01-20 10:23:32 +09:00
Rui Ueyama
d8e3980b86 Do not link libdl
I don't think mold uses any functionality in libdl. mold-wrapper.so
needs it for dlopen()-family functions on non-NetBSD systems though.
2022-01-20 09:28:51 +09:00
Masatake Daimon
af05107964 Do not try to link with -ldl unconditionally
Some operating systems, like NetBSD, don't have a separate library for
dlopen(3). They have dl* functions in their libc.

Signed-off-by: Masatake Daimon <pho@NetBSD.org>
2022-01-19 11:16:55 +09:00
Rui Ueyama
5fc0e503e1 Do not use CPPFLAGS for C++ compiler flags
The correct variable name is `CXXFLAGS`. `CPPFLAGS` is for C preprocessor
flags in the Makefile.
2022-01-14 15:34:55 +09:00
Rui Ueyama
f4a37b2e95 Do not use clang/clang++ as the default compilers
mold does not have to be built with clang/clang++, so don't use
these compiler frontends.

mold also doesn't have be built with g++ (GNU C++ compiler).
We use `c++` command instead.

Fixes https://github.com/rui314/mold/issues/261
2022-01-07 18:45:05 +09:00
Rui Ueyama
1acabd65e3 Add a comment 2022-01-06 23:42:15 +09:00
Rui Ueyama
fe14a08761 Make make to take EXTRA_CFLAGS and EXTRA_CXXFLAGS 2022-01-05 21:36:48 +09:00
Rui Ueyama
31a6a1164e
Merge pull request #248 from sina-ht/use-pkg-config
Use pkg-config to know where openssl header files reside
2022-01-05 18:40:55 +09:00
Hiroshi Takekawa
e8bdbaab22 Use pkg-config to know where openssl header files reside
Let Makefile know how to locate openssl header files in a directory other than
the default directories by using pkg-config. If you don't have pkg-config, then
$(shell) returns empty.

Signed-off-by: Hiroshi Takekawa <sian.ht@gmail.com>
2022-01-05 18:25:17 +09:00
Rui Ueyama
0565a6a6ff
Merge pull request #241 from sina-ht/use-pkg-config
Use pkg-config to know where libcrypto resides
2022-01-04 15:05:34 +09:00
Hiroshi Takekawa
6987f06151 Use pkg-config to know where libcrypto resides
Let Makefile know how to link libcrypto in a directory other than the default
directories by using pkg-config. If you don't have pkg-config, then $(shell)
returns empty.

Signed-off-by: Hiroshi Takekawa <sian.ht@gmail.com>
2022-01-04 14:16:09 +09:00
Rui Ueyama
1bc7c332ab Do not link against librt on Android
Fixes https://github.com/rui314/mold/issues/231
2022-01-04 13:44:55 +09:00
Rui Ueyama
70704c7c09 Disable -Wc++11-narrowing on Android
Fixes https://github.com/rui314/mold/issues/231
2022-01-03 20:59:19 +09:00
Rui Ueyama
5029a6d044 Simplify 2022-01-03 20:56:59 +09:00
Moon Sungjoon
3fb54162d6 Fix build error on riscv64 (#222)
Patch from this PR: https://github.com/oneapi-src/oneTBB/pull/550

Signed-off-by: Moon Sungjoon <sumoon@seoulsaram.org>
2022-01-03 16:06:02 +09:00
Rui Ueyama
d743acb6cd Disable mimalloc on Android host 2021-12-31 16:14:15 +09:00
Rui Ueyama
cb2b4b8f72 Bump mold version to 1.0.1 2021-12-31 14:10:03 +09:00
Rui Ueyama
7a8beac1c2 [Mach-O] Remove homebrew paths from -L and -I flags
I added homebrew's library paths to -L and -I flags for libxxhash.
Now mold includes libxxhash as a subdirectory, we don't need it.
2021-12-31 00:45:58 +09:00
Rui Ueyama
3f8f2e89e5 Show "Passed all tests" message in green 2021-12-30 15:05:17 +09:00
Rui Ueyama
946e0c3acd Avoid uname -o
macOS's uname does not support the `-o` option.
2021-12-29 16:12:05 +09:00
Rui Ueyama
e1ce8994b9
Merge pull request #204 from Ingrater/fixAndroidBuild
Fix building on Android
2021-12-29 15:55:57 +09:00
Benjamin Thaut
f943da88d7 Do not use mimalloc when building on Android as it causes a infinite recursuion.
Signed-off-by: Benjamin Thaut <code@benjamin-thaut.de>
2021-12-27 17:13:25 +01:00
Rui Ueyama
e8dcecfff0 [ELF] Create a symlink to mold as /usr/libexec/mold/ld
So that you can pass that directory name as an argument for `-B`.
2021-12-27 13:37:35 +09:00
Rui Ueyama
0d3c9811c1 Improve make test 2021-12-25 16:59:43 +09:00
Christoph Erhardt
d858068975 Do not use custom LDFLAGS for linking mold-wrapper.so
Linking a dynamic library with `-static` would prevent it from being
loadable.

Fixes #191.

Signed-off-by: Christoph Erhardt <github@sicherha.de>
2021-12-23 10:41:53 +01:00
Rui Ueyama
dbc9869d7e Revert "[ELF] Use RE2 for version script symbol matching"
This reverts commit 27147dfe32.

I don't think the performance improvement wasn't large enough to
justify adding more dependencies to third-party libraries.

https://github.com/rui314/mold/issues/156
2021-12-18 13:26:35 +09:00
Rui Ueyama
27147dfe32 [ELF] Use RE2 for version script symbol matching
This is an attempt to speed up version script application.
It looks like RE2 is faster than libstdc++'s std::regex.
This change reduces libQt6Gui.so.6.3.0's link time by about 30%.

https://github.com/rui314/mold/issues/156
2021-12-18 13:23:18 +09:00
Rui Ueyama
665bffa52f Import xxhash library to third-party for ease of building
In some environment, XXH3 isn't available as a binary package.
If you do not like to use the imported xxhash library but instead
link to system's libxxhash.so, invoke make with `SYSTEM_XXHASH=1`.
2021-12-18 13:05:54 +09:00
Rui Ueyama
4f37c3d024 Fix tests in non-English environment
These test files are not only invoked by make by also directly by hand.
Unsetting `LANG` on each file so that they don't fail in a non-English
environment.

This change is mechanically created by the following command:

  sed -i '1 a export LANG=' test/*/*.sh
2021-12-17 20:06:50 +09:00
Rui Ueyama
072cf0eb30
Merge pull request #153 from sylvestre/patch-1
Force the execution of tests in English
2021-12-17 20:02:31 +09:00
Sylvestre Ledru
9a96dc1c33 Force the execution of tests in English
If the tests are executed in a different locale like French, some logs  (ex: ```out/test/elf/auxiliary/log```) can contain output like:

```La section dynamique à l'offset 0x2000 contient 10 entrées :```

which of course doesn't work as the grep is
```
fgrep -q 'Auxiliary library: [foo]' $t/log
```

Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
2021-12-17 09:25:42 +01:00
Rui Ueyama
a9f9163d2c Fix macOS build failure 2021-12-17 08:51:31 +09:00
Miguel Raz Guzmán Macedo
d3adb6ca09
add missing -lrt flag to Makefile (#141)
* add missing -lrt flag to Makefile

vis #140

* update where -lrt is added to Makefile

* add -lrt in Makefile to appropriate line

Signed-off-by: Miguel Raz Guzmán Macedo <miguelraz@gmail.com>
2021-12-17 08:47:01 +09:00
Rui Ueyama
ed9924895d Bump mold version to 1.0.0 2021-12-15 21:25:26 +09:00
Rui Ueyama
d9903d72c7 Make make uninstall to remove an installed man page 2021-12-15 10:41:50 +09:00
Sam James
0c6458da26 build: don't compress man page
Negligible saving and downstream, distributions usually recompress or
compress with their own specific options. Unconditionally compressing
man pages, while well intended, usually creates more hassle there.

Signed-off-by: Sam James <sam@gentoo.org>
2021-12-14 11:56:47 +00:00
Sam James
770b7312f5 build: respect user *FLAGS
- Respect user CXXFLAGS
- Rename CPPFLAGS (previously used in the sense of "flags for the C++ compiler") -> CXXFLAGS
- CPPFLAGS is generally used for "flags for the C(++) preprocessor.", so let's
  use it for that
- Respect user LDFLAGS
  (In one instance, we were respecting LDFLAGS, but doing it too late.
  We need to pass LDFLAGS _before_ any objects in order for -Wl,--as-needed
  to work correctly.)

Signed-off-by: Sam James <sam@gentoo.org>
2021-12-14 11:56:47 +00:00
Marc-Antoine Perennou
b6549eb4c9 allow overriding strip
Some packaging systems want to handle the stripping by themselves.
Setting e.g. STRIP=true will result in true being used instead of strip
and thus will skip the stripping part, leaving it to the package manager

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2021-12-06 13:32:21 +01:00
Rui Ueyama
bdb01432df [Mach-O] Link against libraries in /opt/homebrew 2021-12-01 20:43:17 +09:00
Rui Ueyama
39676ef7a9 Define BINDIR, LIBDIR and MANDIR
So that it is easy to specify alternative install target paths.
2021-11-19 17:18:15 +09:00
Rui Ueyama
495df9ea00 Change the default install PREFIX from /usr to /usr/local
If not specified, `make install` usually installs binaries to /usr/local.
It's nice to follow that convention.

Fixes https://github.com/rui314/mold/issues/124
2021-10-28 08:06:37 +09:00
Rui Ueyama
45fdfd4e87 Disable C++ exceptions
mold itself doesn't use C++ exceptions, so we can disable C++ exceptions.
Passing `-fno-exceptions` to g++/clang++ makes them to produce smaller code.
2021-10-08 15:04:16 +09:00
Rui Ueyama
9d805f5d26 [Mach-O] Make make test to work on macOS 2021-09-28 18:47:24 +09:00
Rui Ueyama
5e3f526bc1 Refactor 2021-09-28 16:40:07 +09:00
Rui Ueyama
5bd9edeeed Bump mold version to 0.9.6 2021-09-27 20:38:18 +09:00
Rui Ueyama
02b9744d5d Add -g compiler option only when DEBUG=1 2021-09-12 19:42:25 +09:00
Rui Ueyama
c42bd19c49 Add a missing filename 2021-09-08 20:22:51 +09:00
Rui Ueyama
8f10ac5047 [Mach-O] Add a test for mach-o stub 2021-09-08 19:19:07 +09:00
Rui Ueyama
5dab8612c8 Move ELF tests to test/elf directory 2021-09-08 19:13:18 +09:00
Rui Ueyama
bfa24a3205 Create temporary files for tests under out/ 2021-09-08 19:08:52 +09:00