Hello, I use gcc to compile the C/C++ code generated by Nim (https://nim-lang.org/ ). Nim has a feature where it can read in the nim code via pipe. So I can do echo echo NimVersion | nim c -r - Above compiles and runs the "echo NimVersion" code. The first echo is the shell echo command. The reason I am emailing in this mailing list is that that simple command fails with: collect2: fatal error: can't open nm output for older gcc versions 6.1.0 and 7.2.0. I have access to only 3 gcc versions (at work): 6.1.0, 7.2.0 and 9.1.0. And gcc 6.1.0 needs to be the default version for various tool dependency issues. The above error does not happen when using gcc 9.1.0. When I compile the same nim code with -v switches passed to gcc ( echo echo NimVersion | nim c -r --parallelBuild:1 --passC:-v --passL:-v - ), I get: GNU C11 (GCC) version 6.1.0 (x86_64-pc-linux-gnu) compiled by GNU C version 6.1.0, GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.2, isl version none GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 259643b47d2569a7cf09e8b7a67091e7 COLLECT_GCC_OPTIONS='-c' '-w' '-v' '-I' '/home/kmodi/usr_local/apps/6/nim/devel/lib' '-I' '/home/kmodi/sandbox/nim' '-o' '/tmp/kmodi/.cache/nim/stdinfile_d/@m..@s..@s..@s. .@s..@xxxxxxxxxxxxxx.c.o' '-mtune=generic' '-march=x86-64' as -v -W -I /home/kmodi/usr_local/apps/6/nim/devel/lib -I /home/kmodi/sandbox/nim --64 -o /tmp/kmodi/.cache/nim/stdinfile_d/@m..@s. .@s..@s..@s..@xxxxxxxxxxxxxx.c.o /tmp/ccvkFqvG.s GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version version 2.20.51.0.2-5.44.el6 20100205 COMPILER_PATH=/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/ LIBRARY_PATH=/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/../lib64/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-c' '-w' '-v' '-I' '/home/kmodi/usr_local/apps/6/nim/devel/lib' '-I' '/home/kmodi/sandbox/nim' '-o' '/tmp/kmodi/.cache/nim/stdinfile_d/@m..@s..@s..@s. .@s..@xxxxxxxxxxxxxx.c.o' '-mtune=generic' '-march=x86-64' Hint: [Link] Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0 --with-mpfr=/cad/adi/apps/gnu/linux/x86_64/6 --with-mpc=/cad/adi/apps/gnu/linux/x86_64/6 Thread model: posix gcc version 6.1.0 (GCC) COMPILER_PATH=/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/ LIBRARY_PATH=/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/../lib64/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/:/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-o' '/tmp/kmodi/.cache/nim/stdinfile_d/stdinfile' '-v' '-mtune=generic' '-march=x86-64' /cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /tmp/kmodi/.cache/nim/stdinfile_d/stdinfile /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/crtbegin.o -L/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/../lib64 -L/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0 -L/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib -L/cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../.. /tmp/kmodi/.cache/nim/stdinfile_d/stdlib_io.nim.c.o /tmp/kmodi/.cache/nim/stdinfile_d/stdlib_system.nim.c.o /tmp/kmodi/.cache/nim/stdinfile_d/@m..@s..@s..@s..@s..@xxxxxxxxxxxxxx.c.o -lm -ldl -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /cad/adi/apps/gnu/linux/x86_64/6/local/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/crtend.o /usr/lib/../lib64/crtn.o collect2: fatal error: can't open nm output: Success compilation terminated. Error: execution of an external program failed: 'gcc -o /tmp/kmodi/.cache/nim/stdinfile_d/stdinfile /tmp/kmodi/.cache/nim/stdinfile_d/stdlib_io.nim.c.o /tmp/kmodi/.cache/nim/stdinfile_d/stdlib_system.nim.c.o /tmp/kmodi/.cache/nim/stdinfile_d/@m..@s..@s..@s..@s..@xxxxxxxxxxxxxx.c.o -lm -v -ldl' Can someone help figure out if this issue is due to something in my environment or the way Nim handles gcc error codes? Please do Reply All when replying as I am not subscribed to this mailing list. --- If someone doesn't mind reviewing the full debug effort of this issue on the Nim issues page, here is the link: https://github.com/nim-lang/Nim/issues/14060 . Thanks. -- Kaushal Modi