scripts/make_binary_distribution.sh:
Fix the code to get the "libgcc" file name so that the failure of Intel's ICC to provide this information does not cause any problems. This fixes bug#33536 Option "--print-libgcc-file" does not work with ICC compiler scripts/make_binary_distribution.sh: The (old) code to get the "libgcc" file name does not really work when using Intel's ICC. ICC accepts the "--print-libgcc-file" option but ignores it, does not produce any output. However, ICC tricks automake into taking it for a GCC ("GXX" variable is set, see http://www.gnu.org/software/autoconf/manual/html_node/C_002b_002b-Compiler.html#C_002b_002b-Compiler and its discussion of the "AC_PROG_CXX" macro). There are two possible approaches: a) Check "$CC" or "$CXX" to tell ICC from GCC, and do not ask ICC for the "libgcc" file name. b) Just ask it, but protect that code so that its failure does not cause any damage. This patch takes the second route: 1) Put the call "@CC@ ... --print-libgcc-file" into a pipeline, followed by "|| true", so that (for the shell semantics) the command cannot fail. (ICC will exit non-zero because it is not given a source file.) 2) Explicitly redirect any error messages. 3) Do not use the compiler's return code but rather the (non)empty variable to check success. 4) Ensure that the contents really is a file before taking it as a file name. Item 1) is especially important when the tool gets a "set -e" (this happens in 5.1, currently) which would make the failing compiler call a fatal thing. This fixes bug#33536 Option "--print-libgcc-file" does not work with ICC compiler
Showing
Please register or sign in to comment