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

Error compiling for Mac M1 processor #166

Open
devleaks opened this issue Dec 6, 2021 · 6 comments
Open

Error compiling for Mac M1 processor #166

devleaks opened this issue Dec 6, 2021 · 6 comments

Comments

@devleaks
Copy link

devleaks commented Dec 6, 2021

Hello,
I successfully installed brew required packages then make fails at:

dump1090 % make                             
Building with:
  Version string:  unknown
  DSP mix:         arm
  RTLSDR support:  yes
  BladeRF support: yes
  HackRF support:  yes
  LimeSDR support: no
cc -Icpu_features/include -std=c99 -O -g -DSTACK_LINE_READER_BUFFER_SIZE=1024 -DNDEBUG -DHAVE_SYSCTLBYNAME -c cpu_features/src/cpuinfo_arm.c -o cpu_features/src/cpuinfo_arm.o
In file included from cpu_features/src/cpuinfo_arm.c:15:
cpu_features/include/cpuinfo_arm.h:118:2: error: "Including cpuinfo_arm.h from a non-arm target."
#error "Including cpuinfo_arm.h from a non-arm target."
 ^
1 error generated.
make: *** [cpu_features/src/cpuinfo_arm.o] Error 1

Thank you for your input.

@devleaks
Copy link
Author

devleaks commented Dec 6, 2021

arch(1) says arm64.
P.

@mutability
Copy link

mutability commented Dec 6, 2021 via email

@mutability
Copy link

bc72177 should fix this in theory

@devleaks
Copy link
Author

devleaks commented Dec 7, 2021

Makefile needed a lot more twisting than suggested:

  • libusb-1.0 not properly referenced (no -Lpath)
  • "arm64" partially matches "arm", etc.
  • cpu_features compilation is delegated to Makefile.cpufeatures
  • etc.

when I finally got the linker to link, I bumped into this:

Undefined symbols for architecture arm64:
  "_CpuFeatures_GetHardwareCapabilities", referenced from:
      _GetAarch64Info in cpuinfo_aarch64.o
  "_CpuFeatures_IsHwCapsSet", referenced from:
      _GetAarch64Info in cpuinfo_aarch64.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [dump1090] Error 1

Googling for "Including cpuinfo_arm.h from a non-arm target." led me to more editing in google's cpu_features subrepo.
See here.

P.

@devleaks
Copy link
Author

devleaks commented Dec 7, 2021

please note that dump1090 compiles without cpu_features.

@mutability
Copy link

I disabled cpufeatures for that arch/os in fa8a066

For the other issues I'll probably need a PR as I don't have an environment to test any of this.

sdlyyxy added a commit to sdlyyxy/dump1090-fa that referenced this issue Aug 16, 2022
Some versions of librtlsdr (including the version installed by Homebrew
bottle) wrongly declare -lusb-1.0 in its pkg-config file's Libs section.
On Apple Silicon Macs, Homebrew installs libusb dylibs in /opt/homebrew/lib,
which is not a known path for linkers and causes build failure. Some people
reported this linker problem in flightaware#166, flightaware#181. This should fix it.

For the redundant -lusb-1.0 problem, also see:
https://gitea.osmocom.org/sdr/rtl-sdr/commit/222517b506278178ab93182d79ccf7eb04d107ce
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