From 4a74938e510c0dad732ae4c48f815dd0f0cabb46 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 13 Feb 2023 08:16:09 +0000 Subject: gentoo auto-resync : 13:02:2023 - 08:16:09 --- sys-libs/efivar/Manifest | 8 +- sys-libs/efivar/efivar-37.ebuild | 42 --- sys-libs/efivar/efivar-38.ebuild | 7 +- sys-libs/efivar/files/efivar-37-ia64-relro.patch | 37 --- sys-libs/efivar/files/efivar-38-ia64-relro.patch | 4 +- sys-libs/efivar/files/efivar-38-lld-fixes.patch | 345 +++++++++++++++++++++++ 6 files changed, 355 insertions(+), 88 deletions(-) delete mode 100644 sys-libs/efivar/efivar-37.ebuild delete mode 100644 sys-libs/efivar/files/efivar-37-ia64-relro.patch create mode 100644 sys-libs/efivar/files/efivar-38-lld-fixes.patch (limited to 'sys-libs/efivar') diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest index 8d0bb193264e..bd1c41338b23 100644 --- a/sys-libs/efivar/Manifest +++ b/sys-libs/efivar/Manifest @@ -1,12 +1,10 @@ -AUX efivar-37-ia64-relro.patch 1702 BLAKE2B faa170f1a0ce1a9c48764cd49b466db4cdc40b3d79dc17954dd4bb043b4a4cae9a3610d14a85ad56fac655ad8a16e00f04cd4f29f506c6d3402d243f272e38d4 SHA512 35b56b6d8c4c682c55b4b2051367aa3be9c8f46950de6f2f4e30b75fdb9abacca037044b35df2efbf37289a72e294314f469b78f2cbd106c989ce43ffd7b05ff AUX efivar-38-Makefile-dep.patch 1126 BLAKE2B aeeddf608f1bcf9c2a729559ccca6c85271159f4ca0ea82b6685995f34c2ae39c996bb0f98bebfc9abf77ef0b679622267ad31f682f312d58a775a837bfe2bd4 SHA512 156314cbc49f2e298b1a46810ce261716384d19f8d1cc3c7a0aaba816c96cde286b52a578338e2948f770e9404f9c292ce6c0319bdb56963e3ac05789473eb45 AUX efivar-38-binutils-2.36.patch 1231 BLAKE2B ccddc04ab83d4dcf570d5a89e43fc27d36e2010513b36d9eb2fcdea71ceb5dba96a064a1cbca9ffdecf17fb5b9cb22cfe89eae4ee3a188547a4ab6fa6b4e2983 SHA512 568bc88b182875c37479c49b3dbf5b8ee6edf8090f940176e67c9aa28dd2ff6f417c70b2bef6b5df99ada2afa33db3efd295ba9de5d68b3ecc5ce1dc3361d042 AUX efivar-38-glibc-2.36.patch 1308 BLAKE2B 78a40f257e6df5acd2683c04fc541ee7d027a43c16fda20846587a7861d539f0c9f5d48323fdc296bc96c263ada1de5139bbf5e72bfd835a97bb38ab3a8491d9 SHA512 cc5e7543d11ec5448a3ede476315e4f96e664af0943dd2558db901203017b28aa805417ebf6f110b7913ae91ef651e9e8ed41705a8d606a35ccafaf9fdd2a845 -AUX efivar-38-ia64-relro.patch 2351 BLAKE2B ba1ec68ab42e8f0ddd37285e520b437464f377feaa235521c28d5e2ddaf0790b9de4a7f7130bf1d71664156cd0a17681a2e10d0522e59eb09a9be0f258f05a42 SHA512 0cc065e530e1e62607ae22e23089458a12ea3113dca96d4074033037b3aa6ef9f0dfc8ea10a7e6f3efa73b3a9bc1c04a442b742b585da003c93aa32878b87221 +AUX efivar-38-ia64-relro.patch 2325 BLAKE2B 952b74c2f3cdaff6ebd8129c7c4a71cbc34aae41bf05c518bce518b0a6f1aea64bfef0a38494e004f4ef83ec6268e2819d15e036c5d5e86d7e55f12f3f0b4e27 SHA512 d56085bdfa5688ca2117a92e0b09f0425fade716f0a16fc99a9d894c936b8dbcdd297ed520498105d6bca7bb2c7042eec8c6fdd3e64b621acbfd948ce00f892b AUX efivar-38-ld-locale.patch 1203 BLAKE2B b5814d3708999288d35d3d972f854087b8c0742f41bb6e3edbb8112d6dd15c8538b5836b78a514df3481f9edb0e0ea08a733237f43943430cb6fe27c06eb655e SHA512 1dcbe473678f400b66de91e8ee5449a94a81ae8b3981a4d8cddb0f20b46aed0755d48f839527586d7f45f2af050fafaa82279de1cc466c0d3fabcc6e2d5ef940 +AUX efivar-38-lld-fixes.patch 12397 BLAKE2B 0aed2f3bed5584f97f38e7d61bc6883e9c3020cadbba2cb37cec3e5b876c6a535f721817a46068d47413551f823489fb048201b81c1e3894eae4d65e3493129c SHA512 008931110a7d9ae7bfd70fae60a2feb01482f4d14ac81c107bdb612d8079546c748905a10a4f1cffee0385cdcee3e7a9c9606bfd24c005ba2333cef2fc444b4b AUX efivar-38-march-native.patch 1203 BLAKE2B 950a72a5ae4872894379a6688e80c796dd43db67667dd0b30515e2911a981339af6069405e3058ef49be159e37fa6000dbf26db1378b665f3acf6204feaee906 SHA512 fbe34223677a80c5b4e98db7a0171d48a6b56a8d2fd6793299200a64e81c1415913b1b098b5bca8183cbd0f6dada9802aa1967607217a7398f189f58370bb44a -DIST efivar-37.tar.bz2 109431 BLAKE2B 813d477d31562b773f6e19f20e9e237b94beed437ce221771770e7d46ff0e657530285f035dc942cc20609185be92dc50319bfe8e10dee642c8bd88403ef6ffe SHA512 305a82ed103c7e3d8f723934019d552677c73558768dd5341f87d0364f5c60824d24f5a8e1bf90075e825908085083d4ecdccec5ac757fd38ee6ac8fea28c3e4 DIST efivar-38.tar.bz2 320221 BLAKE2B 0b96f3d71ddc2246e6a11a5cd32af3d007823c4a283186a428c3f145cd74425a31bd22c4671ad1ab252a3c572991bb1698381cb8bdf51efcbebd62befdc6c070 SHA512 c2f17297c863ece134a9dd758d237fd2df8c8d072f87af1d0bf2bcf9acfc7a53c25597f03fd4fb8cc664b205743d4ffa0ef1b068d0f73c58fa573d40993f3155 -EBUILD efivar-37.ebuild 904 BLAKE2B ee321a2cd1c45699d340586da9b89cd72a1e71dfcf8bd654f9e646ae4a55f905f483849e4ed313abe91a2af5557f984b35b292db220d69777594b8b4af458154 SHA512 1049e94423f23d49bb45b3a7f8b20a32a7e1e6f9cdf4c2a3e6a79cd8736ad2e1c56ad3591e284799c8cadc353f875de77dcb841a26df5b116c165b92d151ab69 -EBUILD efivar-38.ebuild 1348 BLAKE2B e160b458340bf58fd6b99cee4251fe082ca1dc05c73e4c206ba352543d887a0a51252d171b7fefbc8efd04c9eb16ee178e23e6cdc9e05504a2d0908e2f7b47f6 SHA512 f5a9da4f0c4c121e92707ea9bd2eae7badc55b958918b68d233e79413a204d5058b3338b323b311dab6eeba3043561f7099e7dcae533f2262fe93cc958695da0 +EBUILD efivar-38.ebuild 1441 BLAKE2B cf0c97bb1495ada21c98e35d5b9b006ab79bae20c53e6fc7ead4c4f4bf1bcdba3160737de70e10979b454fc4fab75a194f5984af43a4fabb08f3a12d91e1459b SHA512 957163c6ab9167402fc6fbd01d26adb7496d3b014bf7d51551cfa7a8e3a768dc225ba526ee7f5091ea455a85d4b4b1211948a1276aca6b24f26cdc7f88d48ab5 MISC metadata.xml 330 BLAKE2B 0f894cb3c99d8540d6548f06f146360e20fcff309d867c1da96a15d07e5f1ebb2f03114de8527ddd28c26f4b42a7fa9903dd925015b962b4d4094dda86f76d65 SHA512 c03a2d22f945fd9e4a19143da20b884759e0aa88f73f42a70d47d5b1aeeb43201d9452919779d9c3e020371c3d1519a7068d59c0904043572ae0dd09633989e8 diff --git a/sys-libs/efivar/efivar-37.ebuild b/sys-libs/efivar/efivar-37.ebuild deleted file mode 100644 index e6751c0136da..000000000000 --- a/sys-libs/efivar/efivar-37.ebuild +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit toolchain-funcs - -DESCRIPTION="Tools and library to manipulate EFI variables" -HOMEPAGE="https://github.com/rhinstaller/efivar" -SRC_URI="https://github.com/rhinstaller/efivar/releases/download/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0/1" -KEYWORDS="amd64 arm arm64 ~ia64 ppc64 ~riscv x86" - -RDEPEND="dev-libs/popt" -DEPEND="${RDEPEND} - >=sys-kernel/linux-headers-3.18 - virtual/pkgconfig -" - -PATCHES=( - "${FILESDIR}"/${PN}-37-ia64-relro.patch -) - -src_prepare() { - default - sed -i -e 's/-Werror //' gcc.specs || die -} - -src_configure() { - tc-export CC - export CC_FOR_BUILD=$(tc-getBUILD_CC) - tc-ld-disable-gold - export libdir="/usr/$(get_libdir)" - unset LIBS # Bug 562004 - - if [[ -n ${GCC_SPECS} ]]; then - # The environment overrides the command line. - GCC_SPECS+=":${S}/gcc.specs" - fi -} diff --git a/sys-libs/efivar/efivar-38.ebuild b/sys-libs/efivar/efivar-38.ebuild index bd13a3c45113..f9ec399b79fb 100644 --- a/sys-libs/efivar/efivar-38.ebuild +++ b/sys-libs/efivar/efivar-38.ebuild @@ -1,4 +1,4 @@ -# Copyright 2014-2022 Gentoo Authors +# Copyright 2014-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -29,12 +29,15 @@ DEPEND="${RDEPEND} src_prepare() { local PATCHES=( - "${FILESDIR}"/efivar-38-ia64-relro.patch "${FILESDIR}"/efivar-38-march-native.patch "${FILESDIR}"/efivar-38-Makefile-dep.patch "${FILESDIR}"/efivar-38-binutils-2.36.patch "${FILESDIR}"/efivar-38-ld-locale.patch "${FILESDIR}"/efivar-38-glibc-2.36.patch + "${FILESDIR}"/efivar-38-lld-fixes.patch + + # Rejected upstream, keep this for ia64 support + "${FILESDIR}"/efivar-38-ia64-relro.patch ) default } diff --git a/sys-libs/efivar/files/efivar-37-ia64-relro.patch b/sys-libs/efivar/files/efivar-37-ia64-relro.patch deleted file mode 100644 index 92a79aec88e4..000000000000 --- a/sys-libs/efivar/files/efivar-37-ia64-relro.patch +++ /dev/null @@ -1,37 +0,0 @@ -https://github.com/rhboot/efivar/pull/164 -https://bugs.gentoo.org/749963 - -From: Sergei Trofimovich -Date: Mon, 19 Oct 2020 19:05:01 +0100 -Subject: [PATCH] gcc.specs: drop --fatal-warnings from linker options (ia64 - compatibility) - -``` -$ LANG=C make HOSTCC=x86_64-pc-linux-gnu-gcc CC=ia64-unknown-linux-gnu-gcc HOST_ARCH=ia64 -ia64-unknown-linux-gnu-gcc ... \ - -o libefivar.so ... -/usr/libexec/gcc/ia64-unknown-linux-gnu/ld: warning: -z relro ignored -collect2: error: ld returned 1 exit status -make[1]: *** [/home/slyfox/dev/git/efivar/src/include/rules.mk:32: libefivar.so] Error 1 -``` - -ia64 (and a few others) binutils target does not support '-z relro' and always -issues a warning. --fatal-warnings spec option turns the build into always failing one. - -The change drops `--fatal-warnings` options from gcc.spec entirely. - -Reported-by: Émeric Maschino -Bug: https://bugs.gentoo.org/749963 -Signed-off-by: Sergei Trofimovich ---- a/gcc.specs -+++ b/gcc.specs -@@ -11,7 +11,7 @@ - + %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} - - *self_spec: --+ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} -++ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-static -static -Wl,-z,relro,-z,now} - - *link: --+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:% +Date: Tue, 31 May 2022 11:53:32 -0400 +Subject: [PATCH] Remove deprecated --add-needed linker flag + +Resolves #204 +Signed-off-by: Ali Abdel-Qader +--- + src/include/defaults.mk | 2 -- + src/include/gcc.specs | 2 +- + 2 files changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/include/defaults.mk b/src/include/defaults.mk +index b8cc590c..42bd3d6e 100644 +--- a/src/include/defaults.mk ++++ b/src/include/defaults.mk +@@ -51,7 +51,6 @@ LDFLAGS ?= + override _CCLDFLAGS := $(CCLDFLAGS) + override _LDFLAGS := $(LDFLAGS) + override LDFLAGS = $(CFLAGS) -L. $(_LDFLAGS) $(_CCLDFLAGS) \ +- -Wl,--add-needed \ + -Wl,--build-id \ + -Wl,--no-allow-shlib-undefined \ + -Wl,--no-undefined-version \ +@@ -98,7 +97,6 @@ override _HOST_LDFLAGS := $(HOST_LDFLAGS) + override _HOST_CCLDFLAGS := $(HOST_CCLDFLAGS) + override HOST_LDFLAGS = $(HOST_CFLAGS) -L. \ + $(_HOST_LDFLAGS) $(_HOST_CCLDFLAGS) \ +- -Wl,--add-needed \ + -Wl,--build-id \ + -Wl,--no-allow-shlib-undefined \ + -Wl,-z,now \ +diff --git a/src/include/gcc.specs b/src/include/gcc.specs +index ef28e2bb..d85e8658 100644 +--- a/src/include/gcc.specs ++++ b/src/include/gcc.specs +@@ -5,4 +5,4 @@ + + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} -grecord-gcc-switches + + *link: +-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:% +Date: Wed, 29 Jun 2022 21:44:29 +0200 +Subject: [PATCH] LLD: fix detection and remove not needed workarounds +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Tomasz Paweł Gajc +--- + src/include/workarounds.mk | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/include/workarounds.mk b/src/include/workarounds.mk +index b72fbaf6..57394edd 100644 +--- a/src/include/workarounds.mk ++++ b/src/include/workarounds.mk +@@ -2,12 +2,12 @@ + # + # workarounds.mk - workarounds for weird stuff behavior + +-LD_FLAVOR := $(shell LC_ALL=C $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/ .*//g') +-LD_VERSION := $(shell LC_ALL=C $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/.* //') ++LD_FLAVOR := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/ .*//g') ++LD_VERSION := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/.* //') + # 2.35 is definitely broken and 2.36 seems to work + LD_DASH_T := $(shell \ + if [ "x${LD_FLAVOR}" = xLLD ] ; then \ +- echo '-T' ; \ ++ echo "" ; \ + elif [ "x${LD_FLAVOR}" = xGNU ] ; then \ + if echo "${LD_VERSION}" | grep -q -E '^2\.3[6789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \ + echo '-T' ; \ +@@ -15,7 +15,7 @@ LD_DASH_T := $(shell \ + echo "" ; \ + fi ; \ + else \ +- echo "Your linker is not supported" ; \ ++ echo "Your linker ${LD_FLAVOR} version ${LD_VERSION} is not supported" ; \ + exit 1 ; \ + fi) + +From cfd686de51494d3e34be896a91835657ccab37d4 Mon Sep 17 00:00:00 2001 +From: Nicholas Vinson +Date: Mon, 10 Oct 2022 14:22:36 -0400 +Subject: [PATCH] Revamp efi_well_known_* variable handling + +The current implementation attempts to use the linker to create aliases +for efi_well_known_guids and efi_well_known_names. It also tries to use +the linker to generate the variables efi_well_known_guids_end and +efi_well_known_names_end. + +When building with clang, the generated linker result results in a +broken libefivar.so that causes programs to segfault when linked against +it. This change does away with linker script hacker and instead +introduces pointers to store the locations of efi_well_known_guids_end +and efi_well_known_names_end. + +Additionally, efi_well_known_guids and efi_well_known_names are now +created as pointers that point to the beginning of their respective +arrays. + +Signed-off-by: Nicholas Vinson +Fixes: #234 +--- + src/Makefile | 7 ++-- + src/include/rules.mk | 5 +-- + src/include/workarounds.mk | 24 ------------- + src/makeguids.c | 72 +++++++++++++------------------------- + 4 files changed, 27 insertions(+), 81 deletions(-) + delete mode 100644 src/include/workarounds.mk + +diff --git a/src/Makefile b/src/Makefile +index e04357a7..ec1eabe6 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -4,7 +4,6 @@ include $(TOPDIR)/src/include/deprecated.mk + include $(TOPDIR)/src/include/version.mk + include $(TOPDIR)/src/include/rules.mk + include $(TOPDIR)/src/include/defaults.mk +-include $(TOPDIR)/src/include/workarounds.mk + + LIBTARGETS=libefivar.so libefiboot.so libefisec.so + STATICLIBTARGETS=libefivar.a libefiboot.a libefisec.a +@@ -30,7 +29,7 @@ EFISECDB_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFISECDB_SOURCES))) + GENERATED_SOURCES = include/efivar/efivar-guids.h guid-symbols.c + MAKEGUIDS_SOURCES = makeguids.c util-makeguids.c + MAKEGUIDS_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(MAKEGUIDS_SOURCES))) +-MAKEGUIDS_OUTPUT = $(GENERATED_SOURCES) guids.lds ++MAKEGUIDS_OUTPUT = $(GENERATED_SOURCES) + + util-makeguids.c : util.c + cp util.c util-makeguids.c +@@ -84,7 +83,7 @@ $(MAKEGUIDS_OUTPUT) : guids.txt + if [ "$${missing}" != "no" ]; then \ + exit 1 ; \ + fi +- ./makeguids $(LD_DASH_T) guids.txt guid-symbols.c include/efivar/efivar-guids.h guids.lds ++ ./makeguids guids.txt guid-symbols.c include/efivar/efivar-guids.h + + prep : makeguids $(GENERATED_SOURCES) + +@@ -96,7 +95,6 @@ libefivar.a : $(patsubst %.o,%.static.o,$(LIBEFIVAR_OBJECTS)) + libefivar.so : $(LIBEFIVAR_OBJECTS) + libefivar.so : | $(GENERATED_SOURCES) libefivar.map + libefivar.so : LIBS=dl +-libefivar.so : LDSCRIPTS=guids.lds + libefivar.so : MAP=libefivar.map + + efivar : $(EFIVAR_OBJECTS) | libefivar.so +@@ -137,7 +135,6 @@ deps : $(ALL_SOURCES) + clean : + @rm -rfv *~ *.o *.a *.E *.so *.so.* *.pc *.bin .*.d *.map \ + makeguids guid-symbols.c include/efivar/efivar-guids.h \ +- guids.lds \ + $(TARGETS) $(STATICTARGETS) + @# remove the deps files we used to create, as well. + @rm -rfv .*.P .*.h.P *.S.P include/efivar/.*.h.P +diff --git a/src/include/rules.mk b/src/include/rules.mk +index f309f863..8d0b68a2 100644 +--- a/src/include/rules.mk ++++ b/src/include/rules.mk +@@ -3,7 +3,6 @@ default : all + .PHONY: default all clean install test + + include $(TOPDIR)/src/include/version.mk +-include $(TOPDIR)/src/include/workarounds.mk + + comma:= , + empty:= +@@ -36,9 +35,7 @@ family = $(foreach FAMILY_SUFFIX,$(FAMILY_SUFFIXES),$($(1)_$(FAMILY_SUFFIX))) + $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) -o $@ $(sort $^) $(LDLIBS) + + %.so : +- $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) $(SOFLAGS) \ +- $(foreach LDS,$(LDSCRIPTS),$(LD_DASH_T) $(LDS)) \ +- -o $@ $^ $(LDLIBS) ++ $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) $(SOFLAGS) -o $@ $^ $(LDLIBS) + ln -vfs $@ $@.1 + + %.abixml : %.so +diff --git a/src/include/workarounds.mk b/src/include/workarounds.mk +deleted file mode 100644 +index 57394edd..00000000 +--- a/src/include/workarounds.mk ++++ /dev/null +@@ -1,24 +0,0 @@ +-# SPDX-License-Identifier: SPDX-License-Identifier: LGPL-2.1-or-later +-# +-# workarounds.mk - workarounds for weird stuff behavior +- +-LD_FLAVOR := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/ .*//g') +-LD_VERSION := $(shell LC_ALL=C $(LD) --version | grep -E '^((.* )?LLD|GNU ld)'|sed 's/.* LLD/LLD/;s/.* //') +-# 2.35 is definitely broken and 2.36 seems to work +-LD_DASH_T := $(shell \ +- if [ "x${LD_FLAVOR}" = xLLD ] ; then \ +- echo "" ; \ +- elif [ "x${LD_FLAVOR}" = xGNU ] ; then \ +- if echo "${LD_VERSION}" | grep -q -E '^2\.3[6789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \ +- echo '-T' ; \ +- else \ +- echo "" ; \ +- fi ; \ +- else \ +- echo "Your linker ${LD_FLAVOR} version ${LD_VERSION} is not supported" ; \ +- exit 1 ; \ +- fi) +- +-export LD_DASH_T +- +-# vim:ft=make +diff --git a/src/makeguids.c b/src/makeguids.c +index 376bffba..bfdee12e 100644 +--- a/src/makeguids.c ++++ b/src/makeguids.c +@@ -107,51 +107,46 @@ write_guidnames(FILE *out, const char *listname, + gn->symbol, gn->name, gn->description); + } + fprintf(out, "};\n"); ++ fprintf(out, "const struct efivar_guidname\n" ++ "\t__attribute__((__visibility__ (\"default\")))\n" ++ "\t* const %s = %s_;\n", listname, listname); ++ fprintf(out, "const struct efivar_guidname\n" ++ "\t__attribute__((__visibility__ (\"default\")))\n" ++ "\t* const %s_end = %s_\n\t+ %zd;\n", ++ listname, listname, n - 1); + } + + int + main(int argc, char *argv[]) + { + int rc; +- int argstart = 0; +- FILE *symout, *header, *ldsout; +- int dash_t = 0; ++ FILE *symout, *header; + +- if (argc < 5) { ++ if (argc < 4) { + errx(1, "Not enough arguments.\n"); +- } else if (argc > 5 && !strcmp(argv[1],"-T")) { +- argstart = 1; +- dash_t = 1; +- } else if (argc > 5) { ++ } else if (argc > 4) { + errx(1, "Too many arguments.\n"); + } + +- symout = fopen(argv[argstart + 2], "w"); ++ symout = fopen(argv[2], "w"); + if (symout == NULL) +- err(1, "could not open \"%s\"", argv[argstart + 2]); +- rc = chmod(argv[argstart + 2], 0644); ++ err(1, "could not open \"%s\"", argv[2]); ++ rc = chmod(argv[2], 0644); + if (rc < 0) +- warn("chmod(%s, 0644)", argv[argstart + 2]); ++ warn("chmod(%s, 0644)", argv[2]); + +- header = fopen(argv[argstart + 3], "w"); ++ header = fopen(argv[3], "w"); + if (header == NULL) +- err(1, "could not open \"%s\"", argv[argstart + 3]); +- rc = chmod(argv[argstart + 3], 0644); +- if (rc < 0) +- warn("chmod(%s, 0644)", argv[argstart + 3]); +- +- ldsout = fopen(argv[argstart + 4], "w"); +- if (ldsout == NULL) +- err(1, "could not open \"%s\"", argv[argstart + 4]); +- rc = chmod(argv[argstart + 4], 0644); ++ err(1, "could not open \"%s\"", argv[3]); ++ rc = chmod(argv[3], 0644); + if (rc < 0) +- warn("chmod(%s, 0644)", argv[argstart + 4]); ++ warn("chmod(%s, 0644)", argv[3]); + + struct guidname_index *guidnames = NULL; + +- rc = read_guids_at(AT_FDCWD, argv[argstart + 1], &guidnames); ++ rc = read_guids_at(AT_FDCWD, argv[1], &guidnames); + if (rc < 0) +- err(1, "could not read \"%s\"", argv[argstart + 1]); ++ err(1, "could not read \"%s\"", argv[1]); + + struct efivar_guidname *outbuf; + +@@ -243,12 +238,11 @@ struct efivar_guidname {\n\ + fprintf(header, + "extern const struct efivar_guidname\n" + "\t__attribute__((__visibility__ (\"default\")))\n" +- "\tefi_well_known_guids[%d];\n", +- i); ++ "\t* const efi_well_known_guids;\n"); + fprintf(header, + "extern const struct efivar_guidname\n" + "\t__attribute__((__visibility__ (\"default\")))\n" +- "\tefi_well_known_guids_end;\n"); ++ "\t* const efi_well_known_guids_end;\n"); + fprintf(header, + "extern const uint64_t\n" + "\t__attribute__((__visibility__ (\"default\")))\n" +@@ -256,12 +250,11 @@ struct efivar_guidname {\n\ + fprintf(header, + "extern const struct efivar_guidname\n" + "\t__attribute__((__visibility__ (\"default\")))\n" +- "\tefi_well_known_names[%d];\n", +- i); ++ "\t* const efi_well_known_names;\n"); + fprintf(header, + "extern const struct efivar_guidname\n" + "\t__attribute__((__visibility__ (\"default\")))\n" +- "\tefi_well_known_names_end;\n"); ++ "\t* const efi_well_known_names_end;\n"); + fprintf(header, + "extern const uint64_t\n" + "\t__attribute__((__visibility__ (\"default\")))\n" +@@ -310,23 +303,6 @@ struct efivar_guidname {\n\ + + fclose(symout); + +- fprintf(ldsout, +- "SECTIONS\n" +- "{\n" +- " .data :\n" +- " {\n" +- " efi_well_known_guids = efi_well_known_guids_;\n" +- " efi_well_known_guids_end = efi_well_known_guids_ + %zd;\n" +- " efi_well_known_names = efi_well_known_names_;\n" +- " efi_well_known_names_end = efi_well_known_names_ + %zd;\n" +- " }\n" +- "}%s;\n", +- (line - 1) * sizeof(struct efivar_guidname), +- (line - 1) * sizeof(struct efivar_guidname), +- dash_t ? " INSERT AFTER .data" : ""); +- +- fclose(ldsout); +- + free(guidnames->strtab); + free(guidnames); + -- cgit v1.2.3