瀏覽代碼

[efi] Fix building elf2efi.c when -fpic is enabled by default

The x86_64 EDK2 headers include a #pragma to mark all subsequent
symbol declarations and references as hidden if position-independent
code is being generated.  Since libgen.h is currently included only
after the EDK2 headers, this results in __xpg_basename() being
erroneously marked as having hidden visibility (if the compiler
defaults to building position-independent code); this eventually
results in a failure to link the elf2efi binary.

Fix by including libgen.h prior to including the EDK2 headers.

Originally-fixed-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 年之前
父節點
當前提交
941c53a3bf
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      src/util/elf2efi.c

+ 1
- 1
src/util/elf2efi.c 查看文件

@@ -32,9 +32,9 @@
32 32
 #include <sys/mman.h>
33 33
 #include <fcntl.h>
34 34
 #include <elf.h>
35
+#include <libgen.h>
35 36
 #include <ipxe/efi/Uefi.h>
36 37
 #include <ipxe/efi/IndustryStandard/PeImage.h>
37
-#include <libgen.h>
38 38
 
39 39
 #define eprintf(...) fprintf ( stderr, __VA_ARGS__ )
40 40
 

Loading…
取消
儲存