1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-21 01:47:11 +03:00
Commit Graph

3193 Commits

Author SHA1 Message Date
Rui Ueyama
9326f90d14 Remove dead code
Fixes https://github.com/rui314/mold/issues/175
2021-12-22 17:08:41 +09:00
Rui Ueyama
390e737dea Attempt to silence cppcheck warning
https://github.com/rui314/mold/issues/176
2021-12-22 17:06:23 +09:00
Rui Ueyama
358464d5ad Reduce docker image size for ./build-static.sh
Suggested by https://github.com/rui314/mold/issues/161#issuecomment-997184302.
2021-12-22 14:01:46 +09:00
Rui Ueyama
5bc8bc9d64 Fix -Wall warnings
Fixes https://github.com/rui314/mold/issues/174
2021-12-22 12:10:20 +09:00
Rui Ueyama
74fdf90d70 Fix a test for clang and clang-as
clang-as does not support --keep-locals, so use its synonym -L
which is supported both by GNU as and clang-as.

Fixes https://github.com/rui314/mold/issues/173
2021-12-22 11:42:29 +09:00
Rui Ueyama
530568e662 [ELF] Use a better type 2021-12-20 20:08:25 +09:00
Rui Ueyama
f9ff04866e [ELF] Add --threads=N option
Fixes https://github.com/rui314/mold/issues/168
2021-12-20 16:29:22 +09:00
Rui Ueyama
96c44be33d [ELF] Add an assertion 2021-12-20 14:38:36 +09:00
Rui Ueyama
2bd3bc6d47 Revert "[ELF] Relax TLSLD error check"
This reverts commit 1baac27e8c.

In order to link gcc 7's output, relaxing this error check wasn't
enough as reported on https://github.com/rui314/mold/issues/145.
We need to remove more error checks or keep them as-is.
For now, I'll restore all the error checks, but before making another
release, I may remove all error checks to accept gcc 7's buggy
output files.
2021-12-20 13:38:53 +09:00
Rui Ueyama
fb89ce22fd Update third-party/mimalloc to v2.0.3 2021-12-20 13:01:38 +09:00
Rui Ueyama
3e397d6e78 Cosmetic changes 2021-12-20 12:35:06 +09:00
Rui Ueyama
c824e7831a [ELF] Show a hint if -b binary is given
Fixes https://github.com/rui314/mold/issues/164
2021-12-20 12:26:02 +09:00
Rui Ueyama
8f1c328d1a Cosmetic changes 2021-12-20 11:46:28 +09:00
Rui Ueyama
4d78510cb0 [ELF] Keep SHF_MERGE and SHF_STRINGS bits
Once object files are linked into an executable or a shared object file,
sections are no longer splittable. So these bits don't make sense anymore.

Previously, we cleared the bits. But it looks like there are tools that
are picky about them. So we'll just leave them as-is.

Fixes https://github.com/rui314/mold/issues/155
2021-12-18 17:05:41 +09: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
65dc32fdb8 Merge commit '0621402e0a83a71ee5a13e92ce6a5de0f14dc1f2' as 'third-party/xxhash' 2021-12-18 12:42:16 +09:00
Rui Ueyama
0621402e0a Squashed 'third-party/xxhash/' content from commit 35b0373c
git-subtree-dir: third-party/xxhash
git-subtree-split: 35b0373c697b5f160d3db26b1cbb45a0d5ba788c
2021-12-18 12:42:16 +09:00
Rui Ueyama
1d6d0e2fe3
Merge pull request #158 from sylvestre/second-fix
test/pie.sh: extend the check to other output
2021-12-17 20:16:07 +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
Rui Ueyama
455e729393 [ELF] Make version script application faster
Instead of calling regex match multiple times, create a single
regex and call regex match function only once.

https://github.com/rui314/mold/issues/156
2021-12-17 19:09:26 +09:00
Sylvestre Ledru
fbee0ec588 test/pie.sh: extend the check to other output
On debian unstable, the output doesn't contain 'Shared object file'
Parsing a different output

Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
2021-12-17 10:02:21 +01: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
36633895e5 [ELF] Fix undefined symbol versions
Previously, if the following conditions are met:

 - we are creating a shared object file,
 - there's an undefined symbol in an input object file that are
   to be promoted to a dynamic symbol, and
 - a version script defining a default version is given,

then the symbol gets the default version. But that's a wrong behavior
because version scripts should not affect symbols that are not defined
in an output file.

This change fixes the issue by not setting version to such symbol.

Fixes https://github.com/rui314/mold/issues/151
2021-12-17 17:07:36 +09:00
Rui Ueyama
1baac27e8c [ELF] Relax TLSLD error check
This is a workaround for https://github.com/rui314/mold/issues/145
2021-12-17 14:35:43 +09:00
Rui Ueyama
a9f9163d2c Fix macOS build failure 2021-12-17 08:51:31 +09:00
Rui Ueyama
e4fc96f691 [ELF] Improve error message 2021-12-17 08:47: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
46f22a2778
Merge pull request #147 from Frederik-Baetens/main
fix clang pkg name in fedora instructions
2021-12-16 21:02:20 +09:00
Rui Ueyama
75bd303b15
Merge branch 'main' into main 2021-12-16 21:02:00 +09:00
Rui Ueyama
1c9eea0033
Merge pull request #148 from markusgod/patch-1
Add libstdc++-devel to fedora dependencies.
2021-12-16 20:39:08 +09:00
Mark Nefedov
c77271aa56
Add libstdc++-devel to fedora dependencies.
In build environments such as SUSE OBS or Fedora COPR build fails without clang standard library.

https://build.opensuse.org/package/show/home:MarkNefedov/mold
2021-12-16 14:35:46 +03:00
Rui Ueyama
04d5abc9eb Attempt to fix an ODR violation 2021-12-16 20:34:13 +09:00
Frederik Baetens
031ee33093 fix clang pkg name in fedora instructions 2021-12-16 12:22:30 +01:00
Rui Ueyama
307552a70c
Merge pull request #144 from rurban/patch-2
start stop copy pasta
2021-12-16 15:43:20 +09:00
Reini Urban
f17a2eb941
start stop copy pasta 2021-12-16 07:31:21 +01:00
Rui Ueyama
613ca6fc80
Merge pull request #143 from thesamesam/main
build: fix build-static.sh (adapt to Makefile changes: respect LDFLAGS)
2021-12-16 14:31:03 +09:00
Sam James
e610f62818
build: fix build-static.sh (adapt to Makefile changes: respect LDFLAGS)
Closes: https://github.com/rui314/mold/issues/138
Signed-off-by: Sam James <sam@gentoo.org>
2021-12-16 04:18:32 +00:00
Rui Ueyama
6fd76f2619 [Mach-O] Fix build breakage on Alpine by renaming PAGE_SIZE
PAGE_SIZE is sometimes defined by a header file as macro.
This change renames it COMMON_PAGE_SIZE.

Fixes https://github.com/rui314/mold/issues/142
2021-12-16 13:05:13 +09:00
Rui Ueyama
ed9924895d Bump mold version to 1.0.0 2021-12-15 21:25:26 +09:00
Rui Ueyama
27f72ac320 Fix tests 2021-12-15 20:42:27 +09:00
Rui Ueyama
ba1b63eb76 Fix GCC 10 link failure
Fixes https://github.com/rui314/mold/issues/136
2021-12-15 14:42:01 +09:00
Rui Ueyama
9c651d513a Update README 2021-12-15 10:44:58 +09:00
Rui Ueyama
d9903d72c7 Make make uninstall to remove an installed man page 2021-12-15 10:41:50 +09:00
Rui Ueyama
c9a2fd1d7d Fix a test 2021-12-15 10:36:51 +09:00
Rui Ueyama
e99baebc49
Merge pull request #135 from thesamesam/main
build: respect user *FLAGS, don't compress man pages
2021-12-15 10:36:09 +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