Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 1 | If you pass CFLAGS with a leading space, " " gets passed to popen and convinces |
| 2 | gcc to try and open a file called " ". This results in a confusing error message |
| 3 | like: |
| 4 | |
| 5 | x86_64-pokysdk-linux-gcc: error: : No such file or directory |
| 6 | |
| 7 | Avoid this by stripping empty elements out of CFLAGS. |
| 8 | |
| 9 | Upstream-Status: Submitted [https://github.com/besser82/libxcrypt/pull/126] |
| 10 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 11 | |
| 12 | Index: a/build-aux/compute-symver-floor |
| 13 | =================================================================== |
| 14 | --- a/build-aux/compute-symver-floor |
| 15 | +++ b/build-aux/compute-symver-floor |
| 16 | @@ -36,6 +36,8 @@ sub preprocessor_check { |
| 17 | die "C compiler not available\n" unless @CC; |
| 18 | |
| 19 | @CFLAGS = sh_split($ENV{CFLAGS} // q{}); |
| 20 | + # Remove empty elements, particularly leading ones which cause issues with popen below |
| 21 | + @CFLAGS = grep {$_} @CFLAGS; |
| 22 | |
| 23 | # We call ensure_C_locale here, not from the main section, |
| 24 | # because this sub might not get called at all, in which |