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

CPUFEATURES cross-compile. #158

Closed
milkylainen opened this issue Sep 22, 2021 · 6 comments
Closed

CPUFEATURES cross-compile. #158

milkylainen opened this issue Sep 22, 2021 · 6 comments

Comments

@milkylainen
Copy link

Having issues with cross compiling.

Makefile.cpufeatures:
CPUFEATURES_UNAME := $(shell uname)
CPUFEATURES_ARCH := $(shell uname -m)

Immediate set instead of lazy set?
ARCH=aarch64 breaks as uname -m is a x86_64 host.

@mutability
Copy link

Yes, := because we don't want to call uname every time that those variables are referenced.

You should be able to override on the command line, no?

@milkylainen
Copy link
Author

milkylainen commented Sep 22, 2021

For whatever reason that didn't work.
I patched it to a lazy set ?= and handed the ARCH, CPUFEATURES_UNAME and CPUFEATURES_ARCH on the commandline.

@mutability
Copy link

I can't reproduce this, setting CPUFEATURES_ARCH on the command line works fine here:

$ uname -m
x86_64
$ make ARCH=aarch64 CPUFEATURES_ARCH=aarch64 CC=aarch64-linux-gnu-gcc
[...]
aarch64-linux-gnu-gcc -Icpu_features/include -std=c99 -O -g -DSTACK_LINE_READER_BUFFER_SIZE=1024 -DNDEBUG -DHAVE_STRONG_GETAUXVAL -c cpu_features/src/cpuinfo_aarch64.c -o cpu_features/src/cpuinfo_aarch64.o
[...]

@mutability
Copy link

oh, I guess you probably tried with env vars. Try on the command line like I did instead.

All that said, I forget why CPUFEATURES_ARCH does its own lookup, having it default to the value of ARCH would be reasonable

mutability added a commit that referenced this issue Sep 23, 2021
…ARCH,UNAME}.

Change CPUFEATURES_{ARCH,UNAME} defaults to use {ARCH,UNAME} values.

Fixes #158
@mutability
Copy link

Try that commit?

@milkylainen
Copy link
Author

Ah. Yes. I pushed them on env. But the suggested solution works nicely for me.
Built and tested.

As a side note I'm using dump1090 with librtlsdr 0.8.0 under an qemu emulated aarch64 on an embedded x86_64 AMD R1000 with the footprint of a RPi. :) Works ok, even with instruction emulation.

Thanks for the help!

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