diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-13 04:25:35 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-13 04:25:35 +0000 |
commit | e0345ef79b0b4a444151748ce1f5364fc2dd147b (patch) | |
tree | fae82dcea0d46626d0859759f78cec980210eda9 /sys-devel | |
parent | 9b799bc3e58ce4fb84738f6614e4250719c67b55 (diff) |
gentoo auto-resync : 13:11:2023 - 04:25:34
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/Manifest.gz | bin | 10641 -> 10642 bytes | |||
-rw-r--r-- | sys-devel/gcc/Manifest | 2 | ||||
-rw-r--r-- | sys-devel/gcc/gcc-14.0.0_pre20231112.ebuild | 64 | ||||
-rw-r--r-- | sys-devel/mold/Manifest | 11 | ||||
-rw-r--r-- | sys-devel/mold/files/mold-2.3.2-mimalloc-visibility-interposition.patch | 495 | ||||
-rw-r--r-- | sys-devel/mold/mold-1.11.0.ebuild | 89 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.0.0-r1.ebuild | 93 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.0.0-r2.ebuild | 94 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.3.2-r1.ebuild (renamed from sys-devel/mold/mold-2.3.1.ebuild) | 4 | ||||
-rw-r--r-- | sys-devel/mold/mold-9999.ebuild | 3 |
10 files changed, 569 insertions, 286 deletions
diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz Binary files differindex 2b229717167b..45c02b0ebcee 100644 --- a/sys-devel/Manifest.gz +++ b/sys-devel/Manifest.gz diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest index 405b01a7b0da..8ed10fe553f8 100644 --- a/sys-devel/gcc/Manifest +++ b/sys-devel/gcc/Manifest @@ -41,6 +41,7 @@ DIST gcc-14-20231015.tar.xz 86138880 BLAKE2B e6dece3d6c4337c5ac85fec3fcd31117baf DIST gcc-14-20231022.tar.xz 86217644 BLAKE2B e3248d78323370e3afa3082e89e507860d45d4eaebdf479edebca71deab1a85a6b27845057090fb155e5e53e5d3eb24647e2482ebf1f63645a73ad3561b26b94 SHA512 bbe013c7d226c64e4b4f95c12464f48177c8dd7acfdd1f6f8f2f650c48a4e11e70b724728accff9f135fc6d234fb7dc01ca20a414468ccf43c2b81d0ddc73e1f DIST gcc-14-20231029.tar.xz 86262312 BLAKE2B 871b95efa775d4aa12a5224b9dffeb8ffa8fa168275890f651f5868ca7d9ad4a26cda625e69592618e933d8995307dba83aecc7fab82bb6bcc2d81177cbe3d20 SHA512 237533b45de45ff99d93ebba8aa2b410ba9a93d9aa61851a9451696d3cd5ab893361d55809cd41741e356f3f1ee48b6ade2a9fca136dd155b219d3f19ac2b5a1 DIST gcc-14-20231105.tar.xz 86309008 BLAKE2B b990c5080a80a00bdfe8a838cef9a266b24e8e4204b4c746f4af2cc374ae37a9ce03b3b2a91aa81d9ac09dd005084e48c24591fc160cf3e73a920f6a07dfc40e SHA512 7c2a873fc6a6cfdf64909aeba0c34c98b9901cdbc7b182b1c79c89cb5205fed8ad868e5b2269d06d7415f88a7859420d4dbc5abecd58f2d3c89e9a5eaf3b8a8f +DIST gcc-14-20231112.tar.xz 86265592 BLAKE2B 6608a6df49ac5cf0183368238a89495599317aa86c9dba83de979f269af50cc1ef201a0e9b8986ae4b4b2ed57de5ecfb47b95c76fcfe44820aacca45212afac7 SHA512 90e98463a7da40c2e39e102d912bb1645336d4c5b97419fcdfce9ff7d05a841c3cbc64c933c04949e069e14f8ac6c909f93af6227d3066dc40d4d1660d47caba DIST gcc-14.0.0-musl-patches-1.tar.xz 3576 BLAKE2B 692baee8a7709905d53aeb150d73a3721c4ba47ee5f397cfb1b5be905cf003ca02b60c94ee294d90ac39645cd5cdf186c7a3aa950c47d8cf680c128ed705b807 SHA512 0592ab98a7142e404623a6511c67dff61e9ade32c3fb2c0e75b456306e0af3799ad13252b50b3d2fdd31e5815d7f0b16b0ad63ab8386fe4d78729fc9c182d617 DIST gcc-14.0.0-patches-4.tar.xz 24132 BLAKE2B 95f382ff1232bc681f4fbd28134a5e781bbce0e472d36b9348f54153791ce2b942c9ca3ea0931df8ed5ef48fb0e71f5a5a941e90dfcbd7162f52a4a6a2df9133 SHA512 867c982ee4ce6e10bc76949d30749427e8d070261fd9253cd1ca6b21273f04303c317057176ad7a58ecde06104d295c3af7526151bab7339851f9b06214bba3d DIST gcc-14.0.0-patches-5.tar.xz 21180 BLAKE2B 4ad48161bb35320141df60b99d2c7791df72f719931a649b45842df2acfb84428815efa11ecad6ff4f219a1fde77ffc5e4ed302e2f8f04e0911f514addb5cc7f SHA512 b47a1bbd7218fe03d6cc4968cb51614c34d1548fa85781c6b85cfa901cd43130f9c503404502c92a629ac6b23559fe3bccf38e3bbcb257524941aaec46774cff @@ -84,6 +85,7 @@ EBUILD gcc-14.0.0_pre20231022-r1.ebuild 1637 BLAKE2B 7a256d0ace58cc1bfe55be7418f EBUILD gcc-14.0.0_pre20231022.ebuild 1595 BLAKE2B 841c5fec24a9b29ee9f0972453256d5181b6f89f9736c0f3e9b8a2e5e3795b5e9fd28175ad509fc62fca96106d1dbd904ce97bfebb5a9c807a2334d2027f8b90 SHA512 f675a76dc60858978519ec7731ca90a32c7dcc8c5ca3430a2dba5e18bd84af736f0b04eb137a0a630b6a52584996d33e8f25699e7b1bfa43f655e86f645d06b3 EBUILD gcc-14.0.0_pre20231029.ebuild 1595 BLAKE2B 841c5fec24a9b29ee9f0972453256d5181b6f89f9736c0f3e9b8a2e5e3795b5e9fd28175ad509fc62fca96106d1dbd904ce97bfebb5a9c807a2334d2027f8b90 SHA512 f675a76dc60858978519ec7731ca90a32c7dcc8c5ca3430a2dba5e18bd84af736f0b04eb137a0a630b6a52584996d33e8f25699e7b1bfa43f655e86f645d06b3 EBUILD gcc-14.0.0_pre20231105.ebuild 1595 BLAKE2B c7d13b8ccf004a1c650f0b9381e314a7edc32de20cd12a4535cdeac74042e1ae0a2786c3633e1eaa82ac49feafcd836e9077e881a890c1f20248a630d22e2f6c SHA512 ae81feafc2f879243ec8f145818c7f385ea2c122c8ff387c38b78542358cd5382b4e66d71c66145f3ed7903e33d1adee63cbc842dd5645b6e265b8127bd0b526 +EBUILD gcc-14.0.0_pre20231112.ebuild 1595 BLAKE2B c7d13b8ccf004a1c650f0b9381e314a7edc32de20cd12a4535cdeac74042e1ae0a2786c3633e1eaa82ac49feafcd836e9077e881a890c1f20248a630d22e2f6c SHA512 ae81feafc2f879243ec8f145818c7f385ea2c122c8ff387c38b78542358cd5382b4e66d71c66145f3ed7903e33d1adee63cbc842dd5645b6e265b8127bd0b526 EBUILD gcc-8.5.0-r1.ebuild 498 BLAKE2B e24f62fdb50bf2e9957cbb85c72adc96d369938a7f552735772de964f7023b8b34bd11e7e544d268cc308e25272084a728bd061f37c568d42ea65d55bb2a2e93 SHA512 f35b353e9f54eb3e1c6f8e0ea262458b41da9bddb993793aff79f765c4d93811744979d34e50c6470a9b2cfb63b7006bd284d819b7a98e56a8b3a34ae570ae76 EBUILD gcc-9.5.0.ebuild 1206 BLAKE2B 262931215488db54cab2141549f997a48e22d0a917917eb670d41d5b155c7685e92eb1bc3843d2eca47dd15a450199aea5d99777d2870ff09b1a79ac8a63bcb0 SHA512 3737a70e70e53a581280ff1449d7d92bb9ffba0919b618ea43d4747e09b2803795a05c07c0e3a2ec8982f8d5594be58f9ac549d329b18dc236ad5159e4a47132 MISC metadata.xml 5254 BLAKE2B b64569d62dd67c2f2dab441bb2c4a65bcd61b4c9d8ad7543e8f91c583501d72ed1474abf785e68c48de298d8391de3d94b9b4020086b2b0fa9cc477114a92e9e SHA512 f1307b7865dc4c2c843b5f498196bf5710e45e3292181b43687ebe85b5e9b26203c9c83ee7872efe2cd93595eca430de91e3a5fd6900f0f62c875308ccbb0303 diff --git a/sys-devel/gcc/gcc-14.0.0_pre20231112.ebuild b/sys-devel/gcc/gcc-14.0.0_pre20231112.ebuild new file mode 100644 index 000000000000..b8c8acca5b24 --- /dev/null +++ b/sys-devel/gcc/gcc-14.0.0_pre20231112.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +TOOLCHAIN_PATCH_DEV="sam" +PATCH_GCC_VER="14.0.0" +PATCH_VER="8" +MUSL_VER="1" +MUSL_GCC_VER="14.0.0" + +if [[ ${PV} == *.9999 ]] ; then + MY_PV_2=$(ver_cut 2) + MY_PV_3=1 + if [[ ${MY_PV_2} == 0 ]] ; then + MY_PV_2=0 + MY_PV_3=0 + else + MY_PV_2=$((${MY_PV_2} - 1)) + fi + + # e.g. 12.2.9999 -> 12.1.1 + TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3} +elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then + # Cheesy hack for RCs + MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5) + MY_P=${PN}-${MY_PV} + GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz" + TOOLCHAIN_SET_S=no + S="${WORKDIR}"/${MY_P} +fi + +inherit toolchain + +if tc_is_live ; then + # Needs to be after inherit (for now?), bug #830908 + EGIT_BRANCH=master +elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then + # Don't keyword live ebuilds + #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + :; +fi + +if [[ ${CATEGORY} != cross-* ]] ; then + # Technically only if USE=hardened *too* right now, but no point in complicating it further. + # If GCC is enabling CET by default, we need glibc to be built with support for it. + # bug #830454 + RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )" + DEPEND="${RDEPEND}" + BDEPEND=">=${CATEGORY}/binutils-2.30[cet(-)?]" +fi + +src_prepare() { + local p upstreamed_patches=( + # add them here + ) + for p in "${upstreamed_patches[@]}"; do + rm -v "${WORKDIR}/patch/${p}" || die + done + + toolchain_src_prepare + + eapply_user +} diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index cae18c759cf8..b2b48452d1bc 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -1,16 +1,11 @@ AUX mold-2.0.0-DT_RELR-dependency.patch 5826 BLAKE2B f728523f8fe758d5f61768b4466e36a5fe44fc019f5c31fa41bf2310ef83db6c7eebfa585f776f0145d6b5727a68a686c0a624702af8ae54624ad2571472c977 SHA512 8ccca7ce514b2dd75a62613554237ef60cb527e892516aba35a6ac62a1a1851d217c5da98c821480a120d83ce071bf01fab390d0e80860d2d65b9ac54a8f03e3 AUX mold-2.0.0-reloc-test-fix.patch 1468 BLAKE2B 197e9876667f4f066d801ff304216498aa4eb718d98badcb1a2eb951ae70984728171f5d1f9945201d7ca316d65a3ee1e3438b3e397246e0bdbc821f109bae59 SHA512 a912f06938d8acac52b673bad8a02ac70f13b47db232a51713d80e33dde93c45c7519b6db24451a072b799d6d7a839aabdb577786758d17535284ebe5b7bb055 AUX mold-2.3.0-no-pch.patch 457 BLAKE2B ac313a6409a2e43b6d26833231cb26c36d3d34f25b25d4217d50fbd1f39eda9d5b42a1939ca8ee48f6dfb73d3c27d7c6111da9beb67a43c72d3c2beb070303b0 SHA512 c79b3e998cbc23ca7069eed95a7d7871371da9c21b6970fe2a1d8dcd1009466e262f63febbc267d364e552b2eb4bebd5d74bc6dc8084d48d4c0e9e02e1d868bc -DIST mold-1.11.0.tar.gz 8210923 BLAKE2B b3854a14a956dd568625fc28c96636e7cadf81b9a93954601b03e249db0aedf726a5a1f24c0758c8189a936501ebb778b472ee6e958fe9f43cb3c3093b2dda2a SHA512 a9068600dd2db757552cce027f358c0b9e6af0941b92f81c1e99e2dde674bd06cc3533d432258e42a2197d9b3f8e7bb263de281928357a79e4fb17fb19719bc0 -DIST mold-2.0.0.tar.gz 9205927 BLAKE2B f80c72c58f4618a74390417fdf90f816810350baf1ac74d21294f5ffba7ee263807175be531c9db77209bd05a31ad11fd84d4aeb03fb057cefac7575f71612d6 SHA512 11c3d1e07fe4fcc28cff58b8e432526e4604aa55b49fa47c9495e439206fb9f6a1686b1c5bd2dc907ffd7fe62ac1c72317619fc8a5d7caaa5c327de585f16827 +AUX mold-2.3.2-mimalloc-visibility-interposition.patch 18190 BLAKE2B dfcc0287bf6dfbcdd91fcb9ebf9b56b3d48ef0e6c83566ce832e1279e6ef83acefaac84822b75978596613802a99318765a08eb9c60ace591b5914c1e194263c SHA512 5596bd7cc81e8f5797960aa3cc24d9f5cff3b464839df9b2ff22bf76d3c22041381415464639d0a2079710ad30acd8b9f593e3cd342aedebd398b3d1196aba67 DIST mold-2.1.0.tar.gz 9278811 BLAKE2B b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a SHA512 f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2 -DIST mold-2.3.1.tar.gz 9958470 BLAKE2B 917e1fd770f841dc4bf6fbbed4954762f3eccff3d01247d4a5eaee7a5dad47f0259eb8ba6a10d13f385c9f0aea4d1ac058ce40070902bf7ef366ad8225cfbd5f SHA512 ea234d0b999bcd308e0c5dae27050ff61fd23971f9c54d5eb5764bfb04064dc68c33f5defd614544762a9891ce4369125a6aac68171e68de4ed09a08d59e599e DIST mold-2.3.2.tar.gz 9970530 BLAKE2B db943ad6fab336a8c9c7b5588895cc1232ebfac25fe9dd884a2fbd71ba8d76b9bf7543b4d98cbda9635a7898e980ec5dc2866ef1d02e7a80e7fb9d7f0cbca443 SHA512 dd98acb351757f99399b7d52589c339648478624323fd45c9e986eaf7f1a60f52ace4c09a2d20246e9340109641bda676735da9de89a277989851bd5f52ea9d0 -EBUILD mold-1.11.0.ebuild 2168 BLAKE2B e6da026cd317d9bce59fb0c802f11571107df36310b4c69c9a1e01386bd989c7c0c785b23eaddee62447ac1aa472096b63156e07640ec7f978c49f08b1c8f765 SHA512 ac3d33eaa80eee576bb4151664bad21647d6517f97a30ac3448a4294f1f92b86a48dd82af340d499510dbca9b84d1960874223ce0c3e229c34efdeacfc4659dd -EBUILD mold-2.0.0-r1.ebuild 2216 BLAKE2B 63f97d8f38f04769b66c914addd6bfa42d877fd002008c66df50cd96827cdf467a759c7726c4fbb3355d9dfb52bc924ffa693cc2c2fb49a3de38cb29d6201863 SHA512 bb5538ce441103f9a45d9f6339dffa27d9904b747b835017c0d761a8498a828cab4db14ffba4a5e520a0a2f35e89b8a7f7c428a70c60ff0fef127b3cb464181f -EBUILD mold-2.0.0-r2.ebuild 2262 BLAKE2B 36664776ccff03553da6d71885104666f3b91be07ab8f4f62c96fc7b116d0499172c9cc43f3b05f5fb2bd6b24f80af93ce0e916ceb7ff6dcefb952c4496cfc16 SHA512 48284ddd900756dcf17cb6e8d7729f7fc45a5019d6760522afcfc6c9e6738df37cafd5e68566569f9465e3288de8f6b4854a9d85d2fc48a0b106a4e3a994e5b0 EBUILD mold-2.1.0.ebuild 2169 BLAKE2B b91dec8fb9890052e06cf40124f7647833a6ea786d95d44863848bfff17c0ba335f28aaac08d6971a619dbb845b9091d1134bae47f70bd811d2fde0f9ca11066 SHA512 5d27926e5003e6bd24ee3baf8258ab043aa660b7a36918500283bbec9d991ad8ea6971add52579ba6ee10a7eeeb97a6dff3a7e065c7292ced42d2f0043e33d1e -EBUILD mold-2.3.1.ebuild 2254 BLAKE2B b768d9a6a562fdc8d376570cd30b960d46e946a08d4ee1ca42d30a5afb4c351b8fe25d8fdf3a3c3e82e4cad2b5d11dffbfb77386db8755545e006adb2dc2ced3 SHA512 eef9344f9832767e76ae50536c725647613bfdc62b0e0bfd782a090434ff04226ab91a382e811ae636efaf7be5b9248e874259acfae3597caa511177aaebc2b2 +EBUILD mold-2.3.2-r1.ebuild 2354 BLAKE2B 29e57a9904a365d0701c1ce5312d86a868fa2a774de8195f276939d6b6787c0f4b60108aa5a6f0ba3ad17bd991891b830600a5ef3e8befa617080cb972c8b22a SHA512 a08f94433862001d6fe50a444f3a50d9ee7aa73c6b76cb6380cbb193399ec5e41386966e8a845c7f7b0570127732b1327c7b3ed7b2fe4345714feb4ea3b0acee EBUILD mold-2.3.2.ebuild 2299 BLAKE2B 82d0b9e69c44234e971de8740f7dffbe427581562420019fbb8fc52cdf6f4be891161a2c8c4029897ee644cd9787df61cc16e31ff14e33fcbf0c15e9682a2c3e SHA512 3fb1bb02abc0e36efad29b73eb62d48bfe874c67fb6cfdb569ced028a126ebdb027d5fa4c1dd460d16fc5dbb2f98bedcd79e4c4eed5514ad25a441d9a6633272 -EBUILD mold-9999.ebuild 2254 BLAKE2B b768d9a6a562fdc8d376570cd30b960d46e946a08d4ee1ca42d30a5afb4c351b8fe25d8fdf3a3c3e82e4cad2b5d11dffbfb77386db8755545e006adb2dc2ced3 SHA512 eef9344f9832767e76ae50536c725647613bfdc62b0e0bfd782a090434ff04226ab91a382e811ae636efaf7be5b9248e874259acfae3597caa511177aaebc2b2 +EBUILD mold-9999.ebuild 2294 BLAKE2B 82186052b195e75f60946fb6c36730b20ccea478dfee065aaa35e2fb5ed2490e5ded76fde6a84b8b5e1c04084bd3475e05ae2679421b547993dca2f26d47715b SHA512 4e65624b420d77bf0ae35e2b1194dd4873b69ac431c1cbfe949034b98343d359f7b31ee394ef95cf97206f7b5be1cd5a6e30a1f130750df8cf3c9a92c8891c99 MISC metadata.xml 424 BLAKE2B a1c0cbdcb86c323fa1e6143c9665ec548f7713e74002a25b2fc26c51b60dae00922d3448a5aaecd5027a8cb026a681386ca7dea90657a3e10b25fb194dafc0d3 SHA512 1adc934e78ca0210743a1aa7479ebc4b5ea0b66a348c4408423460f02b404b885d3a8eca6e89ea8ac53ac9c76e85116965f1eef79e3f3e1f0451c8cf5ce0dfd6 diff --git a/sys-devel/mold/files/mold-2.3.2-mimalloc-visibility-interposition.patch b/sys-devel/mold/files/mold-2.3.2-mimalloc-visibility-interposition.patch new file mode 100644 index 000000000000..e569bfaf3013 --- /dev/null +++ b/sys-devel/mold/files/mold-2.3.2-mimalloc-visibility-interposition.patch @@ -0,0 +1,495 @@ +https://bugs.gentoo.org/917089 +https://github.com/microsoft/mimalloc/issues/360 +https://github.com/rui314/mold/issues/1071 +https://github.com/rui314/mold/commit/da3f5dd4ecf4faaba466ba41c7c30ba4f8f73bfd + +From da3f5dd4ecf4faaba466ba41c7c30ba4f8f73bfd Mon Sep 17 00:00:00 2001 +From: Rui Ueyama <ruiu@cs.stanford.edu> +Date: Sat, 11 Nov 2023 17:59:54 +0900 +Subject: [PATCH] Fix --dynamic-list for DSOs + +--dynamic-list, --export-dynamic-symbol and --export-dynamic-symbol-list +have different semantics for executables and DSOs. If the output is an +executable, they specify a list of symbols that are to be exported. +If the output is a shared object, they specify the list of symbols that +are to be interposable. + +mold havne't implemented the latter semantics. This commit fixes that +issue. + +Fixes https://github.com/rui314/mold/issues/1071 +--- + elf/cmdline.cc | 25 +++----- + elf/linker-script.cc | 35 ++++++----- + elf/main.cc | 16 ----- + elf/mold.h | 17 +++-- + elf/output-chunks.cc | 8 ++- + elf/passes.cc | 122 +++++++++++++++++++++++++++++------- + test/elf/dynamic-list4.sh | 44 +++++++++++++ + test/elf/version-script6.sh | 4 +- + 8 files changed, 194 insertions(+), 77 deletions(-) + create mode 100755 test/elf/dynamic-list4.sh + +diff --git a/elf/cmdline.cc b/elf/cmdline.cc +index 6bc13a300..6c06b4b14 100644 +--- a/elf/cmdline.cc ++++ b/elf/cmdline.cc +@@ -1104,21 +1104,21 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) { + } else if (read_flag("no-keep-memory")) { + } else if (read_arg("max-cache-size")) { + } else if (read_arg("version-script")) { +- // --version-script, --dynamic-list and --export-dynamic-symbol[-list] +- // are treated as positional arguments even though they are actually not +- // positional. This is because linker scripts (a positional argument) +- // can also specify a version script, and it's better to consolidate +- // parsing in read_input_files. In particular, version scripts can +- // modify ctx.default_version which we initialize *after* parsing +- // non-positional args, so the parsing cannot be done right here. ++ // --version-script is treated as positional arguments even though ++ // they are actually not positional. This is because linker scripts ++ // (a positional argument) can also specify a version script, and ++ // it's better to consolidate parsing in read_input_files. In ++ // particular, version scripts can modify ctx.default_version which ++ // we initialize *after* parsing non-positional args, so the parsing ++ // cannot be done right here. + remaining.push_back("--version-script=" + std::string(arg)); + } else if (read_arg("dynamic-list")) { + ctx.arg.Bsymbolic = true; +- remaining.push_back("--dynamic-list=" + std::string(arg)); ++ append(ctx.dynamic_list_patterns, parse_dynamic_list(ctx, arg)); + } else if (read_arg("export-dynamic-symbol")) { +- remaining.push_back("--export-dynamic-symbol=" + std::string(arg)); ++ ctx.dynamic_list_patterns.push_back({arg, "<command line>"}); + } else if (read_arg("export-dynamic-symbol-list")) { +- remaining.push_back("--export-dynamic-symbol-list=" + std::string(arg)); ++ append(ctx.dynamic_list_patterns, parse_dynamic_list(ctx, arg)); + } else if (read_flag("as-needed")) { + remaining.push_back("--as-needed"); + } else if (read_flag("no-as-needed")) { +@@ -1228,11 +1228,6 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) { + if (char *env = getenv("MOLD_REPRO"); env && env[0]) + ctx.arg.repro = true; + +- if (ctx.arg.shared || ctx.arg.export_dynamic) +- ctx.default_version = VER_NDX_GLOBAL; +- else +- ctx.default_version = VER_NDX_LOCAL; +- + if (ctx.arg.default_symver) { + std::string ver = ctx.arg.soname.empty() ? + filepath(ctx.arg.output).filename().string() : std::string(ctx.arg.soname); +diff --git a/elf/linker-script.cc b/elf/linker-script.cc +index 4bdc19e7c..7ad500bb8 100644 +--- a/elf/linker-script.cc ++++ b/elf/linker-script.cc +@@ -312,7 +312,6 @@ read_version_script_commands(Context<E> &ctx, std::span<std::string_view> &tok, + + if (tok[0] == "*") { + ctx.default_version = (is_global ? ver_idx : (u32)VER_NDX_LOCAL); +- ctx.default_version_from_version_script = true; + } else if (is_global) { + ctx.version_patterns.push_back({unquote(tok[0]), current_file<E>->name, + ver_str, ver_idx, is_cpp}); +@@ -367,7 +366,9 @@ void parse_version_script(Context<E> &ctx, MappedFile<Context<E>> *mf) { + } + + template <typename E> +-void read_dynamic_list_commands(Context<E> &ctx, std::span<std::string_view> &tok, ++void read_dynamic_list_commands(Context<E> &ctx, ++ std::vector<DynamicPattern> &result, ++ std::span<std::string_view> &tok, + bool is_cpp) { + while (!tok.empty() && tok[0] != "}") { + if (tok[0] == "extern") { +@@ -376,11 +377,11 @@ void read_dynamic_list_commands(Context<E> &ctx, std::span<std::string_view> &to + if (!tok.empty() && tok[0] == "\"C\"") { + tok = tok.subspan(1); + tok = skip(ctx, tok, "{"); +- read_dynamic_list_commands(ctx, tok, false); ++ read_dynamic_list_commands(ctx, result, tok, false); + } else { + tok = skip(ctx, tok, "\"C++\""); + tok = skip(ctx, tok, "{"); +- read_dynamic_list_commands(ctx, tok, true); ++ read_dynamic_list_commands(ctx, result, tok, true); + } + + tok = skip(ctx, tok, "}"); +@@ -388,29 +389,32 @@ void read_dynamic_list_commands(Context<E> &ctx, std::span<std::string_view> &to + continue; + } + +- if (tok[0] == "*") +- ctx.default_version = VER_NDX_GLOBAL; +- else +- ctx.version_patterns.push_back({unquote(tok[0]), current_file<E>->name, +- "global", VER_NDX_GLOBAL, is_cpp}); +- ++ result.push_back({unquote(tok[0]), "", is_cpp}); + tok = skip(ctx, tok.subspan(1), ";"); + } + } + + template <typename E> +-void parse_dynamic_list(Context<E> &ctx, MappedFile<Context<E>> *mf) { +- current_file<E> = mf; +- std::vector<std::string_view> vec = tokenize(ctx, mf->get_contents()); ++std::vector<DynamicPattern> ++parse_dynamic_list(Context<E> &ctx, std::string_view path) { ++ std::string_view contents = ++ MappedFile<Context<E>>::must_open(ctx, std::string(path))->get_contents(); ++ std::vector<std::string_view> vec = tokenize(ctx, contents); + std::span<std::string_view> tok = vec; ++ std::vector<DynamicPattern> result; + + tok = skip(ctx, tok, "{"); +- read_dynamic_list_commands(ctx, tok, false); ++ read_dynamic_list_commands(ctx, result, tok, false); + tok = skip(ctx, tok, "}"); + tok = skip(ctx, tok, ";"); + + if (!tok.empty()) + SyntaxError(ctx, tok[0]) << "trailing garbage token"; ++ ++ for (DynamicPattern &p : result) ++ p.source = path; ++ ++ return result; + } + + using E = MOLD_TARGET; +@@ -418,6 +422,7 @@ using E = MOLD_TARGET; + template void parse_linker_script(Context<E> &, MappedFile<Context<E>> *); + template std::string_view get_script_output_type(Context<E> &, MappedFile<Context<E>> *); + template void parse_version_script(Context<E> &, MappedFile<Context<E>> *); +-template void parse_dynamic_list(Context<E> &, MappedFile<Context<E>> *); ++template std::vector<DynamicPattern> parse_dynamic_list(Context<E> &, std::string_view); ++ + + } // namespace mold::elf +diff --git a/elf/main.cc b/elf/main.cc +index c4f3cd6ff..6df00cfe9 100644 +--- a/elf/main.cc ++++ b/elf/main.cc +@@ -299,22 +299,6 @@ static void read_input_files(Context<E> &ctx, std::span<std::string> args) { + if (!mf) + Fatal(ctx) << "--version-script: file not found: " << arg; + parse_version_script(ctx, mf); +- } else if (remove_prefix(arg, "--dynamic-list=")) { +- MappedFile<Context<E>> *mf = find_from_search_paths(ctx, std::string(arg)); +- if (!mf) +- Fatal(ctx) << "--dynamic-list: file not found: " << arg; +- parse_dynamic_list(ctx, mf); +- } else if (remove_prefix(arg, "--export-dynamic-symbol=")) { +- if (arg == "*") +- ctx.default_version = VER_NDX_GLOBAL; +- else +- ctx.version_patterns.push_back({arg, "--export-dynamic-symbol", +- "global", VER_NDX_GLOBAL, false}); +- } else if (remove_prefix(arg, "--export-dynamic-symbol-list=")) { +- MappedFile<Context<E>> *mf = find_from_search_paths(ctx, std::string(arg)); +- if (!mf) +- Fatal(ctx) << "--export-dynamic-symbol-list: file not found: " << arg; +- parse_dynamic_list(ctx, mf); + } else if (arg == "--push-state") { + state.push_back({ctx.as_needed, ctx.whole_archive, ctx.is_static, + ctx.in_lib}); +diff --git a/elf/mold.h b/elf/mold.h +index 7ff7c2e6f..d593f6840 100644 +--- a/elf/mold.h ++++ b/elf/mold.h +@@ -1281,8 +1281,15 @@ get_script_output_type(Context<E> &ctx, MappedFile<Context<E>> *mf); + template <typename E> + void parse_version_script(Context<E> &ctx, MappedFile<Context<E>> *mf); + ++struct DynamicPattern { ++ std::string_view pattern; ++ std::string_view source; ++ bool is_cpp = false; ++}; ++ + template <typename E> +-void parse_dynamic_list(Context<E> &ctx, MappedFile<Context<E>> *mf); ++std::vector<DynamicPattern> ++parse_dynamic_list(Context<E> &ctx, std::string_view path); + + // + // lto.cc +@@ -1733,13 +1740,11 @@ struct Context { + } arg; + + std::vector<VersionPattern> version_patterns; +- u16 default_version = VER_NDX_GLOBAL; ++ std::vector<DynamicPattern> dynamic_list_patterns; ++ i64 default_version = -1; + i64 page_size = E::page_size; + std::optional<int> global_lock_fd; + +- // true if default_version is set by a wildcard in version script. +- bool default_version_from_version_script = false; +- + // Reader context + bool as_needed = false; + bool whole_archive = false; +@@ -2034,7 +2039,7 @@ class Symbol { + i32 sym_idx = -1; + + i32 aux_idx = -1; +- u16 ver_idx = 0; ++ i32 ver_idx = -1; + + // `flags` has NEEDS_ flags. + Atomic<u8> flags = 0; +diff --git a/elf/output-chunks.cc b/elf/output-chunks.cc +index f44d448ac..00d5538df 100644 +--- a/elf/output-chunks.cc ++++ b/elf/output-chunks.cc +@@ -2550,8 +2550,12 @@ void VerdefSection<E>::construct(Context<E> &ctx) { + for (std::string_view verstr : ctx.arg.version_definitions) + write(verstr, idx++, 0); + +- for (Symbol<E> *sym : std::span<Symbol<E> *>(ctx.dynsym->symbols).subspan(1)) +- ctx.versym->contents[sym->get_dynsym_idx(ctx)] = sym->ver_idx; ++ for (Symbol<E> *sym : std::span<Symbol<E> *>(ctx.dynsym->symbols).subspan(1)) { ++ i64 ver = sym->ver_idx; ++ if (ver == -1) ++ ver = VER_NDX_GLOBAL; ++ ctx.versym->contents[sym->get_dynsym_idx(ctx)] = ver; ++ } + } + + template <typename E> +diff --git a/elf/passes.cc b/elf/passes.cc +index c6ee0f66b..8c7d5d0f5 100644 +--- a/elf/passes.cc ++++ b/elf/passes.cc +@@ -1612,9 +1612,6 @@ template <typename E> + void apply_version_script(Context<E> &ctx) { + Timer t(ctx, "apply_version_script"); + +- // If all patterns are simple (i.e. not containing any meta- +- // characters and is not a C++ name), we can simply look up +- // symbols. + auto is_simple = [&] { + for (VersionPattern &v : ctx.version_patterns) + if (v.is_cpp || v.pattern.find_first_of("*?[") != v.pattern.npos) +@@ -1622,6 +1619,9 @@ void apply_version_script(Context<E> &ctx) { + return true; + }; + ++ // If all patterns are simple (i.e. not containing any meta- ++ // characters and is not a C++ name), we can simply look up ++ // symbols. + if (is_simple()) { + for (VersionPattern &v : ctx.version_patterns) { + Symbol<E> *sym = get_symbol(ctx, v.pattern); +@@ -1747,44 +1747,124 @@ void compute_import_export(Context<E> &ctx) { + if (!ctx.arg.shared) { + tbb::parallel_for_each(ctx.dsos, [&](SharedFile<E> *file) { + for (Symbol<E> *sym : file->symbols) { +- if (sym->file && !sym->file->is_dso && sym->visibility != STV_HIDDEN) { +- if (sym->ver_idx != VER_NDX_LOCAL || +- !ctx.default_version_from_version_script) { +- std::scoped_lock lock(sym->mu); +- sym->is_exported = true; +- } ++ if (sym->file && !sym->file->is_dso && sym->visibility != STV_HIDDEN && ++ sym->ver_idx != VER_NDX_LOCAL) { ++ std::scoped_lock lock(sym->mu); ++ sym->is_exported = true; + } + } + }); + } + ++ auto should_export = [&](Symbol<E> &sym) { ++ if (sym.visibility == STV_HIDDEN) ++ return false; ++ ++ switch (sym.ver_idx) { ++ case -1: ++ if (ctx.arg.shared) ++ return !((ObjectFile<E> *)sym.file)->exclude_libs; ++ return ctx.arg.export_dynamic; ++ case VER_NDX_LOCAL: ++ return false; ++ default: ++ return true; ++ } ++ }; ++ + // Export symbols that are not hidden or marked as local. + // We also want to mark imported symbols as such. + tbb::parallel_for_each(ctx.objs, [&](ObjectFile<E> *file) { + for (Symbol<E> *sym : file->get_global_syms()) { +- if (!sym->file || sym->visibility == STV_HIDDEN || +- sym->ver_idx == VER_NDX_LOCAL) +- continue; +- +- // If we are using a symbol in a DSO, we need to import it at runtime. +- if (sym->file != file && sym->file->is_dso && !sym->is_absolute()) { +- std::scoped_lock lock(sym->mu); +- sym->is_imported = true; ++ // If we are using a symbol in a DSO, we need to import it. ++ if (sym->file && sym->file->is_dso) { ++ if (!sym->is_absolute()) { ++ std::scoped_lock lock(sym->mu); ++ sym->is_imported = true; ++ } + continue; + } + +- // If we are creating a DSO, all global symbols are exported by default. +- if (sym->file == file) { +- std::scoped_lock lock(sym->mu); ++ // If we have a definition of a symbol, we may want to export it. ++ if (sym->file == file && should_export(*sym)) { + sym->is_exported = true; + +- if (ctx.arg.shared && sym->visibility != STV_PROTECTED && ++ // Exported symbols are marked as imported as well by default ++ // for DSOs. ++ if (ctx.arg.shared && ++ sym->visibility != STV_PROTECTED && + !ctx.arg.Bsymbolic && + !(ctx.arg.Bsymbolic_functions && sym->get_type() == STT_FUNC)) + sym->is_imported = true; + } + } + }); ++ ++ ++ // Apply --dynamic-list, --export-dynamic-symbol and ++ // --export-dynamic-symbol-list options. ++ // ++ // The semantics of these options vary depending on whether we are ++ // creating an executalbe or a shared object. ++ // ++ // For executable, matched symbols are exported. ++ // ++ // For shared objects, matched symbols are imported if it is already ++ // exported so that they are interposable. In other words, symbols ++ // that did not match will be bound locally within the output file, ++ // effectively turning them into protected symbols. ++ MultiGlob matcher; ++ MultiGlob cpp_matcher; ++ ++ auto handle_match = [&](Symbol<E> *sym) { ++ if (ctx.arg.shared) { ++ if (sym->is_exported) ++ sym->is_imported = true; ++ } else { ++ if (sym->file && !sym->file->is_dso && sym->visibility != STV_HIDDEN) ++ sym->is_exported = true; ++ } ++ }; ++ ++ for (DynamicPattern &p : ctx.dynamic_list_patterns) { ++ if (p.is_cpp) { ++ if (!cpp_matcher.add(p.pattern, 1)) ++ Fatal(ctx) << p.source << ": invalid dynamic list entry: " ++ << p.pattern; ++ continue; ++ } ++ ++ if (p.pattern.find_first_of("*?[") != p.pattern.npos) { ++ if (!matcher.add(p.pattern, 1)) ++ Fatal(ctx) << p.source << ": invalid dynamic list entry: " ++ << p.pattern; ++ continue; ++ } ++ ++ handle_match(get_symbol(ctx, p.pattern)); ++ } ++ ++ if (!matcher.empty() || !cpp_matcher.empty()) { ++ tbb::parallel_for_each(ctx.objs, [&](ObjectFile<E> *file) { ++ for (Symbol<E> *sym : file->get_global_syms()) { ++ if (sym->file != file) ++ continue; ++ if (ctx.arg.shared && !sym->is_exported) ++ continue; ++ ++ std::string_view name = sym->name(); ++ ++ if (matcher.find(name)) { ++ handle_match(sym); ++ } else if (!cpp_matcher.empty()) { ++ if (std::optional<std::string_view> s = cpp_demangle(name)) ++ name = *s; ++ if (cpp_matcher.find(name)) ++ handle_match(sym); ++ } ++ } ++ }); ++ } + } + + // Compute the "address-taken" bit for each input section. +diff --git a/test/elf/dynamic-list4.sh b/test/elf/dynamic-list4.sh +new file mode 100755 +index 000000000..83d88887e +--- /dev/null ++++ b/test/elf/dynamic-list4.sh +@@ -0,0 +1,44 @@ ++#!/bin/bash ++. $(dirname $0)/common.inc ++ ++cat <<EOF | $CC -o $t/a.o -c -xc - -fPIC ++#include <stdio.h> ++ ++void foo() { printf("foo1 "); } ++void bar() { printf("bar1 "); } ++void baz() { printf("baz1 "); } ++ ++void print() { ++ foo(); ++ bar(); ++ baz(); ++ printf("\n"); ++} ++EOF ++ ++cat <<EOF > $t/dyn ++{ foo; bar; }; ++EOF ++ ++$CC -B. -shared -o $t/b.so $t/a.o -Wl,--dynamic-list=$t/dyn ++ ++cat <<EOF | $CC -o $t/c.o -c -xc - -fPIC ++#include <stdio.h> ++void foo() { printf("foo2 "); } ++void bar() { printf("bar2 "); } ++void baz() { printf("baz2 "); } ++EOF ++ ++$CC -B. -shared -o $t/d.so $t/c.o ++ ++cat <<EOF | $CC -o $t/e.o -c -xc - ++#include <stdio.h> ++void print(); ++int main() { print(); } ++EOF ++ ++$CC -B. -o $t/exe1 $t/e.o -Wl,-push-state,-no-as-needed $t/b.so -Wl,-pop-state ++$QEMU $t/exe1 | grep -q 'foo1 bar1 baz1' ++ ++$CC -B. -o $t/exe2 $t/e.o -Wl,-push-state,-no-as-needed $t/d.so $t/b.so -Wl,-pop-state ++$QEMU $t/exe2 | grep -q 'foo2 bar2 baz1' +diff --git a/test/elf/version-script6.sh b/test/elf/version-script6.sh +index 74e2f9a89..44f809ef3 100755 +--- a/test/elf/version-script6.sh ++++ b/test/elf/version-script6.sh +@@ -9,10 +9,10 @@ EOF + cat <<EOF | $CXX -fPIC -c -o $t/b.o -xc - + int foo = 5; + int bar = 6; ++int quux = 100; + EOF + +-$CC -B. -shared -Wl,--version-script=$t/a.ver \ +- -o $t/c.so $t/b.o ++$CC -B. -shared -Wl,--version-script=$t/a.ver -o $t/c.so $t/b.o + + cat <<'EOF' > $t/d.ver + VER_Y1 { local; *; }; diff --git a/sys-devel/mold/mold-1.11.0.ebuild b/sys-devel/mold/mold-1.11.0.ebuild deleted file mode 100644 index 4ce10d6ee43c..000000000000 --- a/sys-devel/mold/mold-1.11.0.ebuild +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2021-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit cmake toolchain-funcs - -DESCRIPTION="A Modern Linker" -HOMEPAGE="https://github.com/rui314/mold" -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/rui314/mold.git" - inherit git-r3 -else - SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv ~x86" -fi - -# mold (AGPL-3) -# - xxhash (BSD-2) -LICENSE="AGPL-3 BSD-2" -SLOT="0" - -RDEPEND=" - app-arch/zstd:= - >=dev-cpp/tbb-2021.7.0-r1:= - sys-libs/zlib - !kernel_Darwin? ( - >=dev-libs/mimalloc-2:= - dev-libs/openssl:= - ) -" -DEPEND="${RDEPEND}" - -pkg_pretend() { - # Requires a c++20 compiler, see #831473 - if [[ ${MERGE_TYPE} != binary ]]; then - if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then - die "${PN} needs at least gcc 10" - elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then - die "${PN} needs at least clang 12" - fi - fi -} - -src_prepare() { - cmake_src_prepare - - # Needs unpackaged dwarfdump - rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die - - # Heavy tests, need qemu - rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die - rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die - - # Sandbox sadness - rm test/elf/run.sh || die - sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \ - test/elf/mold-wrapper{,2}.sh || die - - # static-pie tests require glibc built with static-pie support - if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then - rm test/elf/{,ifunc-}static-pie.sh || die - fi -} - -src_configure() { - local mycmakeargs=( - -DMOLD_ENABLE_QEMU_TESTS=OFF - -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS. - -DMOLD_USE_SYSTEM_MIMALLOC=ON - -DMOLD_USE_SYSTEM_TBB=ON - ) - cmake_src_configure -} - -src_install() { - dobin "${BUILD_DIR}"/${PN} - - # https://bugs.gentoo.org/872773 - insinto /usr/$(get_libdir)/mold - doins "${BUILD_DIR}"/${PN}-wrapper.so - - dodoc docs/{design,execstack}.md - doman docs/${PN}.1 - - dosym ${PN} /usr/bin/ld.${PN} - dosym ${PN} /usr/bin/ld64.${PN} - dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld -} diff --git a/sys-devel/mold/mold-2.0.0-r1.ebuild b/sys-devel/mold/mold-2.0.0-r1.ebuild deleted file mode 100644 index 74b7d3ab089c..000000000000 --- a/sys-devel/mold/mold-2.0.0-r1.ebuild +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2021-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit cmake toolchain-funcs - -DESCRIPTION="A Modern Linker" -HOMEPAGE="https://github.com/rui314/mold" -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/rui314/mold.git" - inherit git-r3 -else - SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv ~x86" -fi - -# mold (MIT) -# - xxhash (BSD-2) -LICENSE="MIT BSD-2" -SLOT="0" - -RDEPEND=" - app-arch/zstd:= - >=dev-cpp/tbb-2021.7.0-r1:= - sys-libs/zlib - !kernel_Darwin? ( - >=dev-libs/mimalloc-2:= - dev-libs/openssl:= - ) -" -DEPEND="${RDEPEND}" - -PATCHES=( - "${FILESDIR}"/${P}-reloc-test-fix.patch -) - -pkg_pretend() { - # Requires a c++20 compiler, see #831473 - if [[ ${MERGE_TYPE} != binary ]]; then - if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then - die "${PN} needs at least gcc 10" - elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then - die "${PN} needs at least clang 12" - fi - fi -} - -src_prepare() { - cmake_src_prepare - - # Needs unpackaged dwarfdump - rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die - - # Heavy tests, need qemu - rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die - rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die - - # Sandbox sadness - rm test/elf/run.sh || die - sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \ - test/elf/mold-wrapper{,2}.sh || die - - # static-pie tests require glibc built with static-pie support - if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then - rm test/elf/{,ifunc-}static-pie.sh || die - fi -} - -src_configure() { - local mycmakeargs=( - -DMOLD_ENABLE_QEMU_TESTS=OFF - -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS. - -DMOLD_USE_SYSTEM_MIMALLOC=ON - -DMOLD_USE_SYSTEM_TBB=ON - ) - cmake_src_configure -} - -src_install() { - dobin "${BUILD_DIR}"/${PN} - - # https://bugs.gentoo.org/872773 - insinto /usr/$(get_libdir)/mold - doins "${BUILD_DIR}"/${PN}-wrapper.so - - dodoc docs/{design,execstack}.md - doman docs/${PN}.1 - - dosym ${PN} /usr/bin/ld.${PN} - dosym ${PN} /usr/bin/ld64.${PN} - dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld -} diff --git a/sys-devel/mold/mold-2.0.0-r2.ebuild b/sys-devel/mold/mold-2.0.0-r2.ebuild deleted file mode 100644 index 72bb46594d66..000000000000 --- a/sys-devel/mold/mold-2.0.0-r2.ebuild +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright 2021-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit cmake toolchain-funcs - -DESCRIPTION="A Modern Linker" -HOMEPAGE="https://github.com/rui314/mold" -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/rui314/mold.git" - inherit git-r3 -else - SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" -fi - -# mold (MIT) -# - xxhash (BSD-2) -LICENSE="MIT BSD-2" -SLOT="0" - -RDEPEND=" - app-arch/zstd:= - >=dev-cpp/tbb-2021.7.0-r1:= - sys-libs/zlib - !kernel_Darwin? ( - >=dev-libs/mimalloc-2:= - dev-libs/openssl:= - ) -" -DEPEND="${RDEPEND}" - -PATCHES=( - "${FILESDIR}"/${P}-reloc-test-fix.patch - "${FILESDIR}"/${P}-DT_RELR-dependency.patch -) - -pkg_pretend() { - # Requires a c++20 compiler, see #831473 - if [[ ${MERGE_TYPE} != binary ]]; then - if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then - die "${PN} needs at least gcc 10" - elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then - die "${PN} needs at least clang 12" - fi - fi -} - -src_prepare() { - cmake_src_prepare - - # Needs unpackaged dwarfdump - rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die - - # Heavy tests, need qemu - rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die - rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die - - # Sandbox sadness - rm test/elf/run.sh || die - sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \ - test/elf/mold-wrapper{,2}.sh || die - - # static-pie tests require glibc built with static-pie support - if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then - rm test/elf/{,ifunc-}static-pie.sh || die - fi -} - -src_configure() { - local mycmakeargs=( - -DMOLD_ENABLE_QEMU_TESTS=OFF - -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS. - -DMOLD_USE_SYSTEM_MIMALLOC=ON - -DMOLD_USE_SYSTEM_TBB=ON - ) - cmake_src_configure -} - -src_install() { - dobin "${BUILD_DIR}"/${PN} - - # https://bugs.gentoo.org/872773 - insinto /usr/$(get_libdir)/mold - doins "${BUILD_DIR}"/${PN}-wrapper.so - - dodoc docs/{design,execstack}.md - doman docs/${PN}.1 - - dosym ${PN} /usr/bin/ld.${PN} - dosym ${PN} /usr/bin/ld64.${PN} - dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld -} diff --git a/sys-devel/mold/mold-2.3.1.ebuild b/sys-devel/mold/mold-2.3.2-r1.ebuild index f16aabe0758e..1ff59907edb2 100644 --- a/sys-devel/mold/mold-2.3.1.ebuild +++ b/sys-devel/mold/mold-2.3.2-r1.ebuild @@ -33,6 +33,7 @@ DEPEND="${RDEPEND}" PATCHES=( "${FILESDIR}"/${PN}-2.3.0-no-pch.patch + "${FILESDIR}"/${P}-mimalloc-visibility-interposition.patch ) pkg_pretend() { @@ -72,6 +73,7 @@ src_configure() { -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -DMOLD_ENABLE_QEMU_TESTS=OFF -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS. + -DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin) -DMOLD_USE_SYSTEM_MIMALLOC=ON -DMOLD_USE_SYSTEM_TBB=ON ) @@ -90,5 +92,5 @@ src_install() { dosym ${PN} /usr/bin/ld.${PN} dosym ${PN} /usr/bin/ld64.${PN} - dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld + dosym -r /usr/bin/${PN} /usr/libexec/${PN}/ld } diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild index f16aabe0758e..f602c3b96e96 100644 --- a/sys-devel/mold/mold-9999.ebuild +++ b/sys-devel/mold/mold-9999.ebuild @@ -72,6 +72,7 @@ src_configure() { -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -DMOLD_ENABLE_QEMU_TESTS=OFF -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS. + -DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin) -DMOLD_USE_SYSTEM_MIMALLOC=ON -DMOLD_USE_SYSTEM_TBB=ON ) @@ -90,5 +91,5 @@ src_install() { dosym ${PN} /usr/bin/ld.${PN} dosym ${PN} /usr/bin/ld64.${PN} - dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld + dosym -r /usr/bin/${PN} /usr/libexec/${PN}/ld } |