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

Can't build on Apple M1 (No bswap function found!) #80

Open
charafsalmi opened this issue Sep 22, 2022 · 2 comments
Open

Can't build on Apple M1 (No bswap function found!) #80

charafsalmi opened this issue Sep 22, 2022 · 2 comments

Comments

@charafsalmi
Copy link

Hi,

It seems like there is an issue while trying to build on M1.

charaf@MBP mfcuk % autoreconf -is
 ./configure
 make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./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 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 whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /opt/homebrew/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libnfc >= 1.7.0... yes
checking for inline... inline
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 _Bool... yes
checking for stdbool.h that conforms to C99... yes
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 build system type... aarch64-apple-darwin21.6.0
checking host system type... aarch64-apple-darwin21.6.0
checking for GNU libc compatible malloc... yes
checking for GNU libc compatible realloc... yes
checking for memset... yes
checking for strchr... yes
checking for strtoul... yes
checking for endian.h... no
checking for sys/endian.h... no
checking for CoreFoundation/CoreFoundation.h... yes
checking for byteswap.h... no
checking for unistd.h... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
/Library/Developer/CommandLineTools/usr/bin/make  all-recursive
Making all in src
  CC       mfcuk.o
mfcuk.c:154:4: warning: #warning is a language extension [-Wpedantic]
#  warning "No bswap function found! Using untested alternatives..."
   ^
mfcuk.c:154:4: warning: "No bswap function found! Using untested alternatives..." [-W#warnings]
mfcuk.c:1571:15: warning: result of comparison of constant 0 with expression of type 'bool' is always false [-Wtautological-constant-compare]
        if (0 > nfc_initiator_mifare_cmd(pnd, k, block, &mp)) {
            ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mfcuk.c:165:24: warning: unused function 'bswap_64' [-Wunused-function]
static inline uint64_t bswap_64(uint64_t x)
                       ^
mfcuk.c:237:17: warning: unused function 'mfcuk_verify_key_block' [-Wunused-function]
static uint32_t mfcuk_verify_key_block(nfc_device *pnd, uint32_t uiUID, uint64_t ui64Key, mifare_key_type bKeyType, uint8_t bTagType, uint32_t uiBlock)
                ^
5 warnings generated.
  CCLD     mfcuk
@charafsalmi
Copy link
Author

I tried with the brew version of gcc and make (which is gmake), no more luck:

charaf@MBP mfcuk % autoreconf -is
./configure
gmake
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./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 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 whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /opt/homebrew/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libnfc >= 1.7.0... yes
checking for inline... inline
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 _Bool... yes
checking for stdbool.h that conforms to C99... yes
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 build system type... aarch64-apple-darwin21.6.0
checking host system type... aarch64-apple-darwin21.6.0
checking for GNU libc compatible malloc... yes
checking for GNU libc compatible realloc... yes
checking for memset... yes
checking for strchr... yes
checking for strtoul... yes
checking for endian.h... no
checking for sys/endian.h... no
checking for CoreFoundation/CoreFoundation.h... yes
checking for byteswap.h... no
checking for unistd.h... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
gmake  all-recursive
gmake[1]: Entering directory '/Users/charafsalmi/workspace/mfcuk'
Making all in src
gmake[2]: Entering directory '/Users/charafsalmi/workspace/mfcuk/src'
gmake[2]: Nothing to be done for 'all'.
gmake[2]: Leaving directory '/Users/charafsalmi/workspace/mfcuk/src'
gmake[2]: Entering directory '/Users/charafsalmi/workspace/mfcuk'
gmake[2]: Leaving directory '/Users/charafsalmi/workspace/mfcuk'
gmake[1]: Leaving directory '/Users/charafsalmi/workspace/mfcuk'
charaf@MBP mfcuk % ./mfcuk
zsh: no such file or directory: ./mfcuk

@AntoineHus
Copy link

Hello @charafsalmi,

Is this issue still relevant ? I'm on Mac OS 12 and I compile and use mfcuk without issues.

Thanks

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