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

make.js: trim excess whitespaces from CFLAGS and LDFLAGS #1251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 21, 2023

  1. make.js: trim excess whitespaces from CFLAGS and LDFLAGS

    Excess whitespaces in the CFLAGS and LDFLAGS variables cause `gcc` compilation errors like `aarch64-unknown-linux-gnu-gcc: error: No such file or directory`. This is hard to debug and happens because the `.split(' ')` function will create empty `gcc` arguments, if there are any excess whitespaces in the CFLAGS and LDFLAGS environment variables. This can happen when cross-compiling using a 3rd party toolchain, which manipulates/sets the CFLAGS/LDFLAGS variables and accidentally/carelessly puts to many whitespaces in these flags. We better `trim` any whitespaces from the beginning and end of CFLAGS/LDFLAGS strings and match consecutive whitespaces within the strings via a regex instead, to avoid these nasty and hard to spot compilation errors.
    yojoe committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    b3c640c View commit details
    Browse the repository at this point in the history