Skip to content

Instantly share code, notes, and snippets.

@NightMachinery
Created October 24, 2020 12:21
Show Gist options
  • Save NightMachinery/f68c24a68286a70da7a249564a4047c5 to your computer and use it in GitHub Desktop.
Save NightMachinery/f68c24a68286a70da7a249564a4047c5 to your computer and use it in GitHub Desktop.
❯ /usr/local/Cellar/gcc/10.2.0/bin/gcc-10 sh2bin.c -s -ldl -DSRC=foo.sh -o foo -v 126
Using built-in specs.
COLLECT_GCC=/usr/local/Cellar/gcc/10.2.0/bin/gcc-10
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: ../configure --build=x86_64-apple-darwin19 --prefix=/usr/local/Cellar/gcc/10.2.0 --libdir=/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-10 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 10.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk SED=/usr/bin/sed
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (Homebrew GCC 10.2.0)
COLLECT_GCC_OPTIONS='-s' '-D' 'SRC=foo.sh' '-o' 'foo' '-v' '-mmacosx-version-min=10.15.0' '-asm_macosx_version_min=10.15' '-mtune=core2'
/usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/cc1 -quiet -v -D__DYNAMIC__ -D SRC=foo.sh sh2bin.c -fPIC -quiet -dumpbase sh2bin.c -mmacosx-version-min=10.15.0 -mtune=core2 -auxbase sh2bin -version -o /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T//cca0e2Y9.s
GNU C17 (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
warning: MPFR header version 4.0.2 differs from library version 4.1.0.
warning: MPC header version 1.1.0 differs from library version 1.2.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/local/include"
ignoring nonexistent directory "/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/../../../../../../x86_64-apple-darwin19/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/include
/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/include-fixed
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks
End of search list.
GNU C17 (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
warning: MPFR header version 4.0.2 differs from library version 4.1.0.
warning: MPC header version 1.1.0 differs from library version 1.2.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 4decf7776a312d202dddebf6816110de
COLLECT_GCC_OPTIONS='-s' '-D' 'SRC=foo.sh' '-o' 'foo' '-v' '-mmacosx-version-min=10.15.0' '-mtune=core2'
as -arch x86_64 -v -force_cpusubtype_ALL -mmacosx-version-min=10.15 -o /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T//ccTI3wHq.o /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T//cca0e2Y9.s
Apple clang version 11.0.3 (clang-1103.0.32.59)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
"/Library/Developer/CommandLineTools/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.15.0 -filetype obj -main-file-name cca0e2Y9.s -target-cpu penryn -fdebug-compilation-dir /Users/evar/scripts/c/sh2bin -dwarf-debug-producer "Apple clang version 11.0.3 (clang-1103.0.32.59)" -dwarf-version=4 -mrelocation-model pic -o /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T//ccTI3wHq.o /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T//cca0e2Y9.s
COMPILER_PATH=/usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/:/usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/:/usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/:/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/:/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/
LIBRARY_PATH=/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/:/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/../../../
COLLECT_GCC_OPTIONS='-s' '-D' 'SRC=foo.sh' '-o' 'foo' '-v' '-mmacosx-version-min=10.15.0' '-mtune=core2'
/usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/collect2 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/ -dynamic -arch x86_64 -macosx_version_min 10.15.0 -weak_reference_mismatches non-weak -s -o foo -L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/../../.. /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T//ccTI3wHq.o -lSystem -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -v
collect2 version 10.2.0
/usr/bin/ld -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/ -dynamic -arch x86_64 -macosx_version_min 10.15.0 -weak_reference_mismatches non-weak -s -o foo -L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/../../.. /var/folders/5v/g3zxt_7d64g3sd_56bzpqbvh0000gn/T//ccTI3wHq.o -lSystem -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -v
@(#)PROGRAM:ld PROJECT:ld64-556.6
BUILD 13:10:29 Apr 7 2020
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0
/usr/local/Cellar/gcc/10.2.0/lib/gcc/10
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib
Framework search paths:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/
ld: warning: option -s is obsolete and being ignored
Undefined symbols for architecture x86_64:
"_src", referenced from:
_main in ccTI3wHq.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment