Commit ec0bf811 authored by Ben Gamari's avatar Ben Gamari 🐢

rts: Fix LoadArchive on OS X

parent 7a7bb5d2
......@@ -57,17 +57,14 @@
#include <dlfcn.h>
#endif
#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(gnu_HOST_OS)
# define OBJFORMAT_ELF
#if defined(OBJFORMAT_ELF)
# include "linker/Elf.h"
# include <regex.h> // regex is already used by dlopen() so this is OK
// to use here without requiring an additional lib
#elif defined (mingw32_HOST_OS)
# define OBJFORMAT_PEi386
#elif defined(OBJFORMAT_PEi386)
# include "linker/PEi386.h"
# include <windows.h>
#elif defined(darwin_HOST_OS)
# define OBJFORMAT_MACHO
#elif defined(OBJFORMAT_MACHO)
# include "linker/MachO.h"
# include <regex.h>
# include <mach/machine.h>
......
......@@ -293,4 +293,13 @@ char *cstring_from_section_name(
UChar* strtab);
#endif /* mingw32_HOST_OS */
/* Which object file format are we targetting? */
#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(gnu_HOST_OS)
# define OBJFORMAT_ELF
#elif defined (mingw32_HOST_OS)
# define OBJFORMAT_PEi386
#elif defined(darwin_HOST_OS)
# define OBJFORMAT_MACHO
#endif
#endif /* LINKERINTERNALS_H */
......@@ -9,8 +9,15 @@
#include "PathUtils.h"
#include "LinkerInternals.h"
#include "linker/M32Alloc.h"
/* Platform specific headers */
#if defined(OBJFORMAT_PEi386)
#include "linkers/PEi386.h"
# include "linkers/PEi386.h"
#elif defined(darwin_HOST_OS)
# include "linker/MachO.h"
# include <regex.h>
# include <mach/machine.h>
# include <mach-o/fat.h>
#endif
#include <ctype.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment