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

Cannot build in Apple M1 chip #86

Closed
leiless opened this issue Nov 18, 2021 · 3 comments
Closed

Cannot build in Apple M1 chip #86

leiless opened this issue Nov 18, 2021 · 3 comments

Comments

@leiless
Copy link

leiless commented Nov 18, 2021

$ gcc -print-multi-os-directory
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
diff --git a/autogen.sh b/autogen.sh
index 0a31893..82e0368 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,7 +3,8 @@
 autoreconf --install --symlink -f
 
 libdir() {
-        echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
+        #echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
+        echo $1
 }
 
 args="--prefix=/usr --libdir=$(libdir /usr/lib)"
$ ./autogen.sh
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: linking file 'build-aux/ltmain.sh'
glibtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
glibtoolize: and rerunning glibtoolize and aclocal.
glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:50: warning: The macro `AC_PROG_CC_STDC' is obsolete.
configure.ac:50: You should run autoupdate.
./lib/autoconf/c.m4:1666: AC_PROG_CC_STDC is expanded from...
configure.ac:50: the top level
configure.ac:68: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:68: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:68: the top level
configure.ac:23: installing 'build-aux/compile'
configure.ac:12: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'

----------------------------------------------------------------
Initialized build system. For a common configuration please run:
----------------------------------------------------------------

./configure --prefix=/usr --libdir=/usr/lib

$ ./configure --target=darwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... aarch64-apple-darwin20.6.0
checking host system type... aarch64-apple-darwin20.6.0
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking whether make supports nested variables... (cached) yes
checking how to print strings... printf
checking for a sed that does not truncate output... /opt/homebrew/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking how to convert aarch64-apple-darwin20.6.0 file names to aarch64-apple-darwin20.6.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin20.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a sed that does not truncate output... (cached) /opt/homebrew/bin/gsed
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for inline... inline
checking for size_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for GNU libc compatible malloc... yes
checking for memmove... yes
checking for memset... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libisal_crypto.pc
config.status: executing depfiles commands
config.status: executing libtool commands

        isa-l_crypto 2.24.0
        =====

        prefix:                 /usr
        sysconfdir:             ${prefix}/etc
        libdir:                 ${exec_prefix}/lib
        includedir:             ${prefix}/include

        compiler:               gcc
        cflags:                 -g -O2
        ldflags:

        debug:                  no

$ make
Building isa-l_crypto.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make --no-print-directory all-am
  CC       sha1_mb/sha1_ctx_base.lo
  CC       sha1_mb/sha1_ref.lo
  CPPAS    sha1_mb/aarch64/sha1_mb_multibinary.lo
In file included from sha1_mb/aarch64/sha1_mb_multibinary.S:31:
./include/aarch64_multibinary.h:34:10: fatal error: 'asm/hwcap.h' file not found
#include <asm/hwcap.h>
         ^~~~~~~~~~~~~
1 error generated.
make[1]: *** [sha1_mb/aarch64/sha1_mb_multibinary.lo] Error 1
make: *** [all] Error 2
@leiless
Copy link
Author

leiless commented Nov 18, 2021

#include <asm/hwcap.h> only in Linux kernel header

@gbtucker
Copy link
Contributor

There was also some discussion on how to do this with isa-l in intel/isa-l#164 and intel/isa-l#168 but as I recall, this was left as work in progress due to some issues. I'll add this as new feature request to isa-l_crypto also.

@leiless
Copy link
Author

leiless commented Nov 23, 2021

OK, glad to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants