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

Configure script not picking the CPU type #1567

Open
raks-dev opened this issue Oct 21, 2024 · 0 comments
Open

Configure script not picking the CPU type #1567

raks-dev opened this issue Oct 21, 2024 · 0 comments

Comments

@raks-dev
Copy link

I was setting up MQTT gateway on my Raspberry Pi 4 Model B Rev 1.1 running on Homebridge image 6.6.51+rpt-rpi-v8 which is a 64 Bit version.
Build would fail after configure as the flags -mfpu=neon-fp-armv8 and -mfloat-abi=hard get added to it.

I was able to root cause the issue to the below mentioned code:

if [ -z "${SOC}" ]; then
    printf "${SECTION} Detecting target machine.\n"
    info=($(detect_machine))
    SOC=${info[0]}
    TYPE=${info[1]}
    CPU=${info[2]}
    printf "  ${OK} machine detected: SoC=${SOC}, Type=${TYPE}, CPU=${CPU}.\n"
fi

if [ -z "${CPUFLAGS}" ]; then
    CPUFLAGS=$(gcc_cpu_flags "${SOC}" "${CPU}")
fi

https://github.com/mysensors/MySensors/blob/development/configure#L575-L586

The CPU variable is set only when SOC flag is unset but used in determining gcc_cpu_flags and results in following error

gcc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
gcc: error: unrecognized command-line option ‘-mfloat-abi=hard’

Proposed Fix:
Add the line CPU=$(eval "uname -m 2>/dev/null") before the if [ -z "${CPUFLAGS}" ]; then and deleting CPU=${info[2]} line.

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

1 participant