Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many tests fail to compile on Mac M1 #695

Closed
VasilyFomin opened this issue Mar 8, 2022 · 1 comment
Closed

Many tests fail to compile on Mac M1 #695

VasilyFomin opened this issue Mar 8, 2022 · 1 comment

Comments

@VasilyFomin
Copy link

VasilyFomin commented Mar 8, 2022

System Details

config.guess:

aarch64-apple-darwin21.3.0

clang:

Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

macOS Monterey 12.2.1, Apple M1 Max

Problems Description

Hi,

I'm trying to get libffi tests running on Mac M1 and facing multiple issues. I'm going to open separate tickets for different issues. In this ticket, I'm building the latest released version and running make check:

git clone https://github.com/libffi/libffi
cd libffi
git checkout v3.4.2
./autogen.sh
CC=clang CXX=clang++ ./configure
make
make check

looking at libffi/aarch64-apple-darwin21.3.0/testsuite/libffi.log:

ld: the target architecture doesn't support executable stacks
clang: error: linker command failed with exit code 1 (use -v to see invocation)
compiler exited with status 1
FAIL: libffi.bhaible/test-call.c -W -Wall -DDGTEST=1 -Wno-unused-variable -Wno-unused-parameter -Wno-uninitialized -O0 (test for excess errors)

I was able to get pass the compilation issue by commenting out these lines:

# Darwin needs a stack execution allowed flag.
if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"]
|| [istarget "*-*-darwin2*"] } {
lappend options "additional_flags=-Wl,-allow_stack_execute"
}

The tests pass:

MAKE aarch64-apple-darwin21.3.0 :        0 * check
Making check in include
make[2]: Nothing to be done for `check'.
Making check in testsuite
/Library/Developer/CommandLineTools/usr/bin/make  check-DEJAGNU
srcdir='../../testsuite'; export srcdir; \
	EXPECT=expect; export EXPECT; \
	if /bin/sh -c "runtest --version" > /dev/null 2>&1; then \
	  exit_status=0; l='libffi'; for tool in $l; do \
	    if runtest --tool $tool --srcdir $srcdir  ; \
	    then :; else exit_status=1; fi; \
	  done; \
	else echo "WARNING: could not find 'runtest'" 1>&2; :;\
	fi; \
	exit $exit_status
WARNING: Couldn't find the global config file.
Using ../../testsuite/lib/libffi.exp as tool init file.
Test run by vfomin on Tue Mar  8 09:44:45 2022
Native configuration is aarch64-apple-darwin21.3.0

		=== libffi tests ===

Schedule of variations:
    unix

Running target unix
Using /opt/homebrew/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /opt/homebrew/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../../testsuite/config/default.exp as tool-and-target-specific interface file.
Running ../../testsuite/libffi.bhaible/bhaible.exp ...
Running ../../testsuite/libffi.call/call.exp ...
Running ../../testsuite/libffi.closures/closure.exp ...
Running ../../testsuite/libffi.complex/complex.exp ...
Running ../../testsuite/libffi.go/go.exp ...

		=== libffi Summary ===

# of expected passes		548
# of unsupported tests		209
Making check in man
make[2]: Nothing to be done for `check'.
Making check in doc
make[2]: Nothing to be done for `check'.
make[2]: Nothing to be done for `check-am'.

This ticket focuses on solving the build issue and I'm going to open a separate ticket to look into failures. Thanks for looking into this!

@atgreen
Copy link
Member

atgreen commented Sep 20, 2022

I believe I fixed this recently.

@atgreen atgreen closed this as completed Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants