Better detect the correct MacOS toolchain

* We need ELF not Mach-O

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This commit is contained in:
Callum Farmer 2024-07-16 10:32:02 +01:00
parent 5d4ada9352
commit 8f5c321507
No known key found for this signature in database
GPG Key ID: 9A5B19E18CD0013C
4 changed files with 7 additions and 3 deletions

View File

@ -40,7 +40,7 @@ jobs:
- name: Build - name: Build
run: | 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 - name: Generate binary information
run: ${{ matrix.cross_compile }}readelf -a ./${{ matrix.dir }}/apps/ctors_dtors_priority_test.so > ./${{ matrix.dir }}/apps/readelf.txt run: ${{ matrix.cross_compile }}readelf -a ./${{ matrix.dir }}/apps/ctors_dtors_priority_test.so > ./${{ matrix.dir }}/apps/readelf.txt

View File

@ -110,7 +110,7 @@ endif
GCCVERSION := $(shell $(CC) -dumpversion | sed -e 's/-win32/.0/' | cut -f1 -d.) GCCVERSION := $(shell $(CC) -dumpversion | sed -e 's/-win32/.0/' | cut -f1 -d.)
GCCMINOR := $(shell $(CC) -dumpversion | sed -e 's/-win32/.0/' | cut -f2 -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_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? # Rely on GCC MS ABI support?
GCCNEWENOUGH := $(shell ( [ $(GCCVERSION) -gt "4" ] \ GCCNEWENOUGH := $(shell ( [ $(GCCVERSION) -gt "4" ] \

View File

@ -37,6 +37,10 @@ Revision History
extern "C" { extern "C" {
#endif #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_VENDOR L"INTEL"
#define EFI_FIRMWARE_MAJOR_REVISION 12 #define EFI_FIRMWARE_MAJOR_REVISION 12
#define EFI_FIRMWARE_MINOR_REVISION 33 #define EFI_FIRMWARE_MINOR_REVISION 33

View File

@ -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 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 <elf.h> #include <elf.h>
#else #else