Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Saw-mon-and-Natalie/f99a3c585f2ed3c4febb1f98901c7f80 to your computer and use it in GitHub Desktop.
Save Saw-mon-and-Natalie/f99a3c585f2ed3c4febb1f98901c7f80 to your computer and use it in GitHub Desktop.
macOS: ld: library not found for -lgcc

phpbrew install x.x.x +everything

While installing php with phpbrew, I kept getting the following error:

ld: library not found for -lgcc

I needed to symlink a dylib:

cd /usr/local/lib
ln -s ../../lib/libSystem.B.dylib libgcc.dylib
ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib
ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
#! /bin/bash
cc -v -o conftest -g \
-fvisibility=hidden \
-pthread -fprofile-arcs \
-ftest-coverage -O0 \
-I/usr/local/opt/llvm/include \
-I/usr/local/opt/libxml2/include \
-no-cpp-precomp \
-Wl,-rpath,/usr/local/opt/libxml2/lib \
-L/usr/local/opt/libxml2/lib \
-Wl,-rpath,/usr/local/opt/llvm/lib \
-L/usr/local/opt/llvm/lib \
-Wl,-rpath,/usr/local/lib \
-L/usr/local/lib \
-Wl,-rpath,/usr/lib \
-L/usr/lib \
-Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin17.7.0 \
-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin17.7.0 \
conftest.c \
-lm -lpthread -lgcc -lxml2 -lz -liconv -lm
#include "confdefs.h"
char xmlInitParser();
int main() {
xmlInitParser();
return 0;
}
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
#define HAVE_DEV_URANDOM 1
#define HAVE_HUGE_VAL_INF 1
#define HAVE_CPUID_COUNT 1
#define HAVE_SETENV 1
#define HAVE_ERRNO_H 1
#define HAVE_FCNTL_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_UIO_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_SYSEXITS_H 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_MACH_VM_READ 1
#define HAVE_BUILTIN_ATOMIC 1
#define HAVE_SYSCONF 1
#define HAVE_TIMES 1
#define HAVE_KQUEUE 1
#define HAVE_POLL 1
#define HAVE_SELECT 1
#define PHP_FPM_SYSTEMD "simple"
#define PHP_FPM_USER "nobody"
#define PHP_FPM_GROUP "nobody"
#define HAVE_PHPDBG 1
#define PHPDBG_DEBUG 0
#define HAVE_SOCKLEN_T 1
#define HAVE_SOCKADDR_UN_SUN_LEN 1
#define PHP_WRITE_STDOUT 1
#define HAVE_SOCKET 1
#define HAVE_SOCKETPAIR 1
#define HAVE_HTONL 1
#define HAVE_GETHOSTNAME 1
#define HAVE_GETHOSTBYADDR 1
#define HAVE_YP_GET_DEFAULT_DOMAIN 1
#define HAVE_DLOPEN 1
#define HAVE_LIBDL 1
#define HAVE_LIBM 1
#define HAVE_INET_ATON 1
#define STDC_HEADERS 1
#define HAVE_DIRENT_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_DIRENT_H 1
#define HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_ALLOCA_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_ARPA_NAMESER_H 1
#define HAVE_ASSERT_H 1
#define HAVE_DNS_H 1
#define HAVE_FCNTL_H 1
#define HAVE_GRP_H 1
#define HAVE_LANGINFO_H 1
#define HAVE_LIMITS_H 1
#define HAVE_LOCALE_H 1
#define HAVE_MONETARY_H 1
#define HAVE_NETDB_H 1
#define HAVE_POLL_H 1
#define HAVE_PWD_H 1
#define HAVE_RESOLV_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDARG_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_SYSLOG_H 1
#define HAVE_SYSEXITS_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_FILE_H 1
#define HAVE_SYS_MMAN_H 1
#define HAVE_SYS_MOUNT_H 1
#define HAVE_SYS_POLL_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_STATVFS_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
#define HAVE_SYS_UTSNAME_H 1
#define HAVE_SYS_IPC_H 1
#define HAVE_DLFCN_H 1
#define HAVE_ASSERT_H 1
#define HAVE_TMMINTRIN_H 1
#define HAVE_NMMINTRIN_H 1
#define HAVE_IMMINTRIN_H 1
#define HAVE_STRUCT_TM_TM_ZONE 1
#define HAVE_TM_ZONE 1
#define MISSING_FCLOSE_DECL 0
#define HAVE_TM_GMTOFF 1
#define HAVE_STRUCT_FLOCK 1
#define HAVE_SOCKLEN_T 1
#define SIZEOF_SIZE_T 8
#define SIZEOF_LONG_LONG 8
#define SIZEOF_LONG_LONG_INT 8
#define SIZEOF_LONG 8
#define SIZEOF_INT 4
#define SIZEOF_INTMAX_T 8
#define HAVE_INTMAX_T 1
#define SIZEOF_SSIZE_T 8
#define HAVE_SSIZE_T 1
#define SIZEOF_PTRDIFF_T 8
#define HAVE_PTRDIFF_T 1
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#define SIZEOF_LONG 8
#define SIZEOF_LONG_LONG 8
#define HAVE_INT8_T 1
#define HAVE_INT16_T 1
#define HAVE_INT32_T 1
#define HAVE_INT64_T 1
#define HAVE_UINT8_T 1
#define HAVE_UINT16_T 1
#define HAVE_UINT32_T 1
#define HAVE_UINT64_T 1
#define HAVE_U_INT8_T 1
#define HAVE_U_INT16_T 1
#define HAVE_U_INT32_T 1
#define HAVE_U_INT64_T 1
#define PHP_HAVE_STDINT_TYPES 1
#define PHP_HAVE_BUILTIN_EXPECT 1
#define PHP_HAVE_BUILTIN_CLZ 1
#define PHP_HAVE_BUILTIN_CTZL 1
#define PHP_HAVE_BUILTIN_CTZLL 1
#define PHP_HAVE_BUILTIN_SMULL_OVERFLOW 1
#define PHP_HAVE_BUILTIN_SMULLL_OVERFLOW 1
#define PHP_HAVE_BUILTIN_SADDL_OVERFLOW 1
#define PHP_HAVE_BUILTIN_SADDLL_OVERFLOW 1
#define PHP_HAVE_BUILTIN_SSUBL_OVERFLOW 1
#define PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW 1
#define PHP_HAVE_BUILTIN_CPU_INIT 0
#define PHP_HAVE_BUILTIN_CPU_SUPPORTS 1
#define PHP_HAVE_SSSE3_INSTRUCTIONS 1
#define PHP_HAVE_SSE4_2_INSTRUCTIONS 0
#define PHP_HAVE_AVX_INSTRUCTIONS 0
#define PHP_HAVE_AVX2_INSTRUCTIONS 0
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
#define HAVE_STRUCT_STAT_ST_RDEV 1
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
#define HAVE_ST_BLOCKS 1
#define HAVE_SOCKADDR_STORAGE 1
#define HAVE_SOCKADDR_SA_LEN 1
#define HAVE_FUNC_ATTRIBUTE_TARGET 1
#define HAVE_VPRINTF 1
#define HAVE_ALPHASORT 1
#define HAVE_ASCTIME_R 1
#define HAVE_CHROOT 1
#define HAVE_CTIME_R 1
#define HAVE_CRYPT 1
#define HAVE_FLOCK 1
#define HAVE_FTOK 1
#define HAVE_FUNOPEN 1
#define HAVE_GAI_STRERROR 1
#define HAVE_GCVT 1
#define HAVE_GETLOADAVG 1
#define HAVE_GETLOGIN 1
#define HAVE_GETPROTOBYNAME 1
#define HAVE_GETPROTOBYNUMBER 1
#define HAVE_GETSERVBYNAME 1
#define HAVE_GETSERVBYPORT 1
#define HAVE_GETHOSTNAME 1
#define HAVE_GETRUSAGE 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GMTIME_R 1
#define HAVE_GETPWNAM_R 1
#define HAVE_GETGRNAM_R 1
#define HAVE_GETPWUID_R 1
#define HAVE_GRANTPT 1
#define HAVE_INET_NTOA 1
#define HAVE_INET_NTOP 1
#define HAVE_INET_PTON 1
#define HAVE_ISASCII 1
#define HAVE_LINK 1
#define HAVE_LOCALTIME_R 1
#define HAVE_LOCKF 1
#define HAVE_LCHOWN 1
#define HAVE_LRAND48 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MKSTEMP 1
#define HAVE_MMAP 1
#define HAVE_NL_LANGINFO 1
#define HAVE_PERROR 1
#define HAVE_POLL 1
#define HAVE_PTSNAME 1
#define HAVE_PUTENV 1
#define HAVE_REALPATH 1
#define HAVE_RANDOM 1
#define HAVE_RAND_R 1
#define HAVE_SCANDIR 1
#define HAVE_SETITIMER 1
#define HAVE_SETLOCALE 1
#define HAVE_LOCALECONV 1
#define HAVE_SETENV 1
#define HAVE_SETPGID 1
#define HAVE_SETSOCKOPT 1
#define HAVE_SETVBUF 1
#define HAVE_SHUTDOWN 1
#define HAVE_SIN 1
#define HAVE_SNPRINTF 1
#define HAVE_SRAND48 1
#define HAVE_SRANDOM 1
#define HAVE_STATFS 1
#define HAVE_STATVFS 1
#define HAVE_STRCASECMP 1
#define HAVE_STRCOLL 1
#define HAVE_STRDUP 1
#define HAVE_STRERROR 1
#define HAVE_STRFTIME 1
#define HAVE_STRNLEN 1
#define HAVE_STRPTIME 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_SYMLINK 1
#define HAVE_TEMPNAM 1
#define HAVE_TZSET 1
#define HAVE_UNLOCKPT 1
#define HAVE_UNSETENV 1
#define HAVE_USLEEP 1
#define HAVE_UTIME 1
#define HAVE_VSNPRINTF 1
#define HAVE_VASPRINTF 1
#define HAVE_ASPRINTF 1
#define HAVE_NANOSLEEP 1
#define HAVE_GETADDRINFO 1
#define HAVE_SYNC_FETCH_AND_ADD 1
#define HAVE_STRLCAT 1
#define HAVE_STRLCPY 1
#define HAVE_GETOPT 1
#define HAVE_UTIME_H 1
#define HAVE_UTIME_NULL 1
#define HAVE_ALLOCA_H 1
#define HAVE_ALLOCA 1
#define HAVE_DECLARED_TIMEZONE 1
#define HAVE_POSIX_READDIR_R 1
#define HAVE_ASM_GOTO 1
#define HAVE_COMPILER_C99_VLA 1
#define HAVE_GCOV 1
#define PHP_SIGCHILD 0
#define DEFAULT_SHORT_OPEN_TAG "1"
#define HAVE_IPV6 1
#define HAVE_SYS_SDT_H 1
#define HAVE_DTRACE 1
#define HAVE_STRINGS_H 1
#define HAVE_STRTOLL 1
#define HAVE_ATOLL 1
#define HAVE_TIMELIB_CONFIG_H 1
#define HAVE_LIBXML 1
#define HAVE_LIBXML 1
#define HAVE_OPENSSL_EXT 1
#define HAVE_BUNDLED_PCRE 1
#define PCRE2_CODE_UNIT_WIDTH 8
#define HAVE_PCRE_JIT_SUPPORT 1
#define HAVE_SQLITE3_ERRSTR 1
#define HAVE_SQLITE3 1
#define HAVE_ZLIB 1
#define HAVE_BCMATH 1
#define HAVE_BZ2 1
#define HAVE_CALENDAR 1
#define HAVE_CTYPE 1
#define HAVE_CURL_SSL 1
#define HAVE_CURL 1
#define HAVE_CURL_EASY_STRERROR 1
#define HAVE_CURL_MULTI_STRERROR 1
#define DBA_CDB_BUILTIN 1
#define DBA_CDB_MAKE 1
#define DBA_CDB 1
#define DBA_INIFILE 1
#define DBA_FLATFILE 1
#define HAVE_DBA 1
#define HAVE_LIBXML 1
#define HAVE_DOM 1
#define HAVE_EXIF 1
#define HAVE_UTIMES 1
#define HAVE_STRNDUP 1
#define HAVE_FTP 1
#define HAVE_FTP_SSL 1
#define HAVE_LIBFREETYPE 1
#define ENABLE_GD_TTF 1
#define HAVE_LIBFREETYPE 1
#define ENABLE_GD_TTF 1
#define HAVE_LIBGD 1
#define HAVE_GD_PNG 1
#define HAVE_GD_WEBP 1
#define HAVE_GD_JPG 1
#define HAVE_GD_XPM 1
#define HAVE_GD_BMP 1
#define HAVE_GD_FREETYPE 1
#define HAVE_GD_LIBVERSION 1
#define COMPILE_DL_GD 1
#define HAVE_LIBINTL 1
#define HAVE_NGETTEXT 1
#define HAVE_DNGETTEXT 1
#define HAVE_DCNGETTEXT 1
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
#define HAVE_GMP 1
#define PHP_MHASH_BC 1
#define HAVE_HASH_EXT 1
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#define SIZEOF_LONG 8
#define SIZEOF_LONG_LONG 8
#define SIZEOF_LONG_INT 8
#define HAVE_ICONV 1
#define PHP_ICONV_IMPL "libiconv"
#define ICONV_SUPPORTS_ERRNO 1
#define ICONV_BROKEN_IGNORE 0
#define PHP_ICONV_H_PATH </usr/include/iconv.h>
#define HAVE_JSON 1
#define STDC_HEADERS 1
#define SIZEOF_LONG_INT 8
#define HAVE_LDAP 1
#define HAVE_3ARG_SETREBINDPROC 1
#define HAVE_LDAP_PARSE_RESULT 1
#define HAVE_LDAP_PARSE_REFERENCE 1
#define HAVE_LDAP_START_TLS_S 1
#define HAVE_LDAP_CONTROL_FIND 1
#define HAVE_LDAP_PARSE_EXTENDED_RESULT 1
#define HAVE_LDAP_EXTENDED_OPERATION 1
#define HAVE_LDAP_EXTENDED_OPERATION_S 1
#define HAVE_LDAP_PASSWD 1
#define HAVE_LDAP_WHOAMI_S 1
#define HAVE_MBSTRING 1
#define USE_COMBINATION_EXPLOSION_CHECK 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_STDARG_H 1
#define HAVE_LIMITS_H 1
#define SIZEOF_INT 4
#define SIZEOF_SHORT 2
#define SIZEOF_LONG 8
#define TIME_WITH_SYS_TIME 1
#define HAVE_ALLOCA_H 1
#define HAVE_ALLOCA 1
#define HAVE_STDARG_PROTOTYPES 1
#define PHP_ONIG_BUNDLED 1
#define HAVE_ONIG 1
#define HAVE_MBREGEX 1
#define MYSQLI_USE_MYSQLND 1
#define ODBCVER 0x0300
#define HAVE_OPCACHE_FILE_CACHE 1
#define HAVE_HUGE_CODE_PAGES 1
#define HAVE_MPROTECT 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_UIO_H 1
#define HAVE_SHM_IPC 1
#define HAVE_SHM_MMAP_ANON 1
#define HAVE_SHM_MMAP_POSIX 1
#define HAVE_SHM_MMAP_FILE 1
#define COMPILE_DL_OPCACHE 1
#define HAVE_FORK 1
#define HAVE_FORK 1
#define HAVE_WAITPID 1
#define HAVE_WAITPID 1
#define HAVE_SIGACTION 1
#define HAVE_SIGACTION 1
#define HAVE_GETPRIORITY 1
#define HAVE_SETPRIORITY 1
#define HAVE_WAIT3 1
#define HAVE_WAIT4 1
#define HAVE_SIGPROCMASK 1
#define PDO_USE_MYSQLND 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment