diff --git a/.github/workflows/macos-gcc.yml b/.github/workflows/macos-gcc.yml index e4821dc..8e47f23 100644 --- a/.github/workflows/macos-gcc.yml +++ b/.github/workflows/macos-gcc.yml @@ -40,7 +40,7 @@ jobs: - name: Build run: | - make ARCH=${{ matrix.arch }} CROSS_COMPILE=${{ matrix.cross_compile }} USING_APPLE=1 + make ARCH=${{ matrix.arch }} CROSS_COMPILE=${{ matrix.cross_compile }} - name: Generate binary information run: ${{ matrix.cross_compile }}readelf -a ./${{ matrix.dir }}/apps/ctors_dtors_priority_test.so > ./${{ matrix.dir }}/apps/readelf.txt diff --git a/Make.defaults b/Make.defaults index 7ef3ea2..221e157 100755 --- a/Make.defaults +++ b/Make.defaults @@ -110,7 +110,7 @@ endif GCCVERSION := $(shell $(CC) -dumpversion | sed -e 's/-win32/.0/' | cut -f1 -d.) GCCMINOR := $(shell $(CC) -dumpversion | sed -e 's/-win32/.0/' | cut -f2 -d.) USING_CLANG := $(shell $(CC) -v 2>&1 | grep -q 'clang version' && echo clang || echo 0) -USING_APPLE ?= 0 +USING_APPLE ?= $(shell uname -s | grep -q 'Darwin' && echo 1 || echo 0) # Rely on GCC MS ABI support? GCCNEWENOUGH := $(shell ( [ $(GCCVERSION) -gt "4" ] \ diff --git a/inc/efi.h b/inc/efi.h index cec1569..3c426c1 100644 --- a/inc/efi.h +++ b/inc/efi.h @@ -37,6 +37,10 @@ Revision History extern "C" { #endif +#if defined(__APPLE__) +#error "Mach-O toolchain isn't supported; please compile with an ELF toolchain from Homebrew" +#endif + #define EFI_FIRMWARE_VENDOR L"INTEL" #define EFI_FIRMWARE_MAJOR_REVISION 12 #define EFI_FIRMWARE_MINOR_REVISION 33 diff --git a/inc/subst/elf.h b/inc/subst/elf.h index 7004996..f39fe96 100644 --- a/inc/subst/elf.h +++ b/inc/subst/elf.h @@ -11,7 +11,7 @@ You should have received a copy of the GNU Lesser General Public License along w if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(__APPLE__) && !defined(__GNU_EFI_IS_APPLE) +#if !defined(__GNU_EFI_IS_APPLE) #include #else