cmake: Update 2.8 patchset to undo most of elf.h sepcial casing.

Haiku now provides a public elf.h and the special casing lead to build
failures on current x86_gcc2.
This commit is contained in:
Michael Lotz
2016-03-09 21:39:04 +00:00
parent 7a3e613c28
commit 72ab59b56c

View File

@@ -1911,3 +1911,108 @@ index 9e2a93d..4b5ad8f 100644
--
1.8.3.4
From 6e16cf081ba95900b1200e657f06835a1064e3f5 Mon Sep 17 00:00:00 2001
From: Michael Lotz <mmlr@mlotz.ch>
Date: Wed, 9 Mar 2016 21:33:02 +0000
Subject: Undo most of the special casing of elf.h for Haiku.
Haiku now provides a public elf.h. The ELFMAG[0-3] definition is
currently not part of it however, so leave them in with proper guards.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 7dc55db..88caa76 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -15,14 +15,7 @@ CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
if(HAVE_ELF_H)
set(CMAKE_USE_ELF_PARSER 1)
else()
- # Non-standard filename for Haiku, works all the same
- CHECK_INCLUDE_FILE("elf32.h" HAVE_ELF32_H
- "-I/system/develop/headers/private/system -I/system/develop/headers/private/system/arch/x86")
- if(HAVE_ELF32_H)
- set(CMAKE_USE_ELF_PARSER 1)
- else()
- set(CMAKE_USE_ELF_PARSER)
- endif()
+ set(CMAKE_USE_ELF_PARSER)
endif()
set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
@@ -407,14 +400,6 @@ if(APPLE)
target_link_libraries(CMakeLib "-framework CoreFoundation")
endif()
-# On Haiku, elf32.h is hidden in the "private" include dir
-if(HAIKU)
- include_directories(
- "/system/develop/headers/private/system"
- "/system/develop/headers/private/system/arch/x86"
- )
-endif()
-
# On some platforms we need the rpcrt4 library for the VS 7 generators.
if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
target_link_libraries(CMakeLib rpcrt4)
diff --git a/Source/elf.h b/Source/elf.h
index 6b868bb..86ac8f6 100644
--- a/Source/elf.h
+++ b/Source/elf.h
@@ -1,42 +1,14 @@
-/*
- *
- * /boot/common/include/elf.h
- *
- * -I/system/develop/headers/private/system
- * -I/system/develop/headers/private/system/arch_x86
- *
- * As found on other platforms, for benefit of GHC Haskell compiler,
- * Donn
- * */
-
-#ifdef __HAIKU__
-
-#include <elf32.h>
-#include <elf64.h>
-
-typedef struct Elf32_Ehdr Elf32_Ehdr;
-typedef struct Elf32_Shdr Elf32_Shdr;
-typedef struct Elf32_Sym Elf32_Sym;
-typedef struct Elf32_Rel Elf32_Rel;
-typedef struct Elf32_Rela Elf32_Rela;
-
-#define ELFMAG0 0x7F
-#define ELFMAG1 'E'
-#define ELFMAG2 'L'
-#define ELFMAG3 'F'
-
-#define ET_NONE 0
-#define ET_REL 1
-#define ET_EXEC 2
-#define ET_DYN 3
-#define ET_CORE 4
-
-#define EM_386 3
-#define EM_SPARC 2
-#define EM_PPC 20
-
-#else
-
#include_next <elf.h>
+#ifndef ELFMAG0
+# define ELFMAG0 0x7f
+#endif
+#ifndef ELFMAG1
+# define ELFMAG1 'E'
+#endif
+#ifndef ELFMAG2
+# define ELFMAG2 'L'
+#endif
+#ifndef ELFMAG3
+# define ELFMAG3 'F'
#endif
--
2.2.2