In GCC, how to convert a predefined optimization level into a list of finer grained optimization flags? - gcc

I'm measuring how optimization flag number affects the coverage of GCC when it is compiling some test cases. I know GCC has predefined optimization levels, such as -O1 and -O2. I also know how to obtain the list of concrete flags enabled by a predefined level by this command:
$ gcc -O2 -Q --help=optimizer
The following options control optimizations:
-O<number>
-Ofast
-Og
-Os
-faggressive-loop-optimizations [enabled]
-falign-functions [enabled]
-falign-functions=
-falign-jumps [enabled]
-falign-jumps=
-falign-labels [enabled]
-falign-labels=
-falign-loops [enabled]
-falign-loops=
-fallocation-dce [enabled]
-fallow-store-data-races [disabled]
-fassociative-math [disabled]
-fassume-phsa [available in BRIG]
-fasynchronous-unwind-tables [enabled]
-fauto-inc-dec [enabled]
-fbranch-count-reg [enabled]
-fbranch-probabilities [disabled]
-fcaller-saves [enabled]
-fcode-hoisting [enabled]
-fcombine-stack-adjustments [enabled]
-fcompare-elim [enabled]
-fconserve-stack [disabled]
-fcprop-registers [enabled]
-fcrossjumping [enabled]
-fcse-follow-jumps [enabled]
-fcx-fortran-rules [disabled]
-fcx-limited-range [disabled]
-fdce [enabled]
-fdefer-pop [enabled]
-fdelayed-branch [disabled]
-fdelete-dead-exceptions [disabled]
-fdelete-null-pointer-checks [enabled]
-fdevirtualize [enabled]
-fdevirtualize-speculatively [enabled]
-fdse [enabled]
-fearly-inlining [enabled]
-fexceptions [disabled]
-fexcess-precision=[fast|standard] [default]
-fexpensive-optimizations [enabled]
-ffast-math
-ffinite-loops [disabled]
-ffinite-math-only [disabled]
-ffloat-store [disabled]
-fforward-propagate [enabled]
-ffp-contract=[off|on|fast] fast
-ffp-int-builtin-inexact [enabled]
-ffunction-cse [enabled]
-fgcse [enabled]
-fgcse-after-reload [disabled]
-fgcse-las [disabled]
-fgcse-lm [enabled]
-fgcse-sm [disabled]
-fgraphite [disabled]
-fgraphite-identity [disabled]
-fguess-branch-probability [enabled]
-fhandle-exceptions -fexceptions
-fhoist-adjacent-loads [enabled]
-fif-conversion [enabled]
-fif-conversion2 [enabled]
-findirect-inlining [enabled]
-finline [enabled]
-finline-atomics [enabled]
-finline-functions [enabled]
-finline-functions-called-once [enabled]
-finline-small-functions [enabled]
-fipa-bit-cp [enabled]
-fipa-cp [enabled]
-fipa-cp-clone [disabled]
-fipa-icf [enabled]
-fipa-icf-functions [enabled]
-fipa-icf-variables [enabled]
-fipa-profile [enabled]
-fipa-pta [disabled]
-fipa-pure-const [enabled]
-fipa-ra [enabled]
-fipa-reference [enabled]
-fipa-reference-addressable [enabled]
-fipa-sra [enabled]
-fipa-stack-alignment [enabled]
-fipa-vrp [enabled]
-fira-algorithm=[CB|priority] CB
-fira-hoist-pressure [enabled]
-fira-loop-pressure [disabled]
-fira-region=[one|all|mixed] [default]
-fira-share-save-slots [enabled]
-fira-share-spill-slots [enabled]
-fisolate-erroneous-paths-attribute [disabled]
-fisolate-erroneous-paths-dereference [enabled]
-fivopts [enabled]
-fjump-tables [enabled]
-fkeep-gc-roots-live [disabled]
-flifetime-dse [enabled]
-flifetime-dse=<0,2> 2
-flimit-function-alignment [disabled]
-flive-patching -flive-
patching=inline-clone
-flive-patching=[inline-only-static|inline-clone] [default]
-flive-range-shrinkage [disabled]
-floop-interchange [disabled]
-floop-nest-optimize [disabled]
-floop-parallelize-all [disabled]
-floop-unroll-and-jam [disabled]
-flra-remat [enabled]
-fmath-errno [enabled]
-fmodulo-sched [disabled]
-fmodulo-sched-allow-regmoves [disabled]
-fmove-loop-invariants [enabled]
-fnon-call-exceptions [disabled]
-fnothrow-opt [available in C++,
ObjC++]
-fomit-frame-pointer [enabled]
-fopt-info [disabled]
-foptimize-sibling-calls [enabled]
-foptimize-strlen [enabled]
-fpack-struct [disabled]
-fpack-struct=<number>
-fpartial-inlining [enabled]
-fpatchable-function-entry=
-fpeel-loops [disabled]
-fpeephole [enabled]
-fpeephole2 [enabled]
-fplt [enabled]
-fpredictive-commoning [disabled]
-fprefetch-loop-arrays [enabled]
-fprintf-return-value [enabled]
-fprofile-partial-training [disabled]
-fprofile-reorder-functions [disabled]
-freciprocal-math [disabled]
-free [enabled]
-freg-struct-return [disabled]
-frename-registers [enabled]
-freorder-blocks [enabled]
-freorder-blocks-algorithm=[simple|stc] stc
-freorder-blocks-and-partition [enabled]
-freorder-functions [enabled]
-frerun-cse-after-loop [enabled]
-freschedule-modulo-scheduled-loops [disabled]
-frounding-math [disabled]
-frtti [available in C++,
D, ObjC++]
-fsave-optimization-record [disabled]
-fsched-critical-path-heuristic [enabled]
-fsched-dep-count-heuristic [enabled]
-fsched-group-heuristic [enabled]
-fsched-interblock [enabled]
-fsched-last-insn-heuristic [enabled]
-fsched-pressure [disabled]
-fsched-rank-heuristic [enabled]
-fsched-spec [enabled]
-fsched-spec-insn-heuristic [enabled]
-fsched-spec-load [disabled]
-fsched-spec-load-dangerous [disabled]
-fsched-stalled-insns [disabled]
-fsched-stalled-insns-dep [enabled]
-fsched-stalled-insns-dep=<number>
-fsched-stalled-insns=<number>
-fsched2-use-superblocks [disabled]
-fschedule-fusion [enabled]
-fschedule-insns [disabled]
-fschedule-insns2 [enabled]
-fsection-anchors [disabled]
-fsel-sched-pipelining [disabled]
-fsel-sched-pipelining-outer-loops [disabled]
-fsel-sched-reschedule-pipelined [disabled]
-fselective-scheduling [disabled]
-fselective-scheduling2 [disabled]
-fshort-enums [enabled]
-fshort-wchar [disabled]
-fshrink-wrap [enabled]
-fshrink-wrap-separate [enabled]
-fsignaling-nans [disabled]
-fsigned-zeros [enabled]
-fsimd-cost-model=[unlimited|dynamic|cheap] unlimited
-fsingle-precision-constant [disabled]
-fsplit-ivs-in-unroller [enabled]
-fsplit-loops [disabled]
-fsplit-paths [disabled]
-fsplit-wide-types [enabled]
-fsplit-wide-types-early [disabled]
-fssa-backprop [enabled]
-fssa-phiopt [enabled]
-fstack-check=[no|generic|specific]
-fstack-clash-protection [disabled]
-fstack-protector [disabled]
-fstack-protector-all [disabled]
-fstack-protector-explicit [disabled]
-fstack-protector-strong [disabled]
-fstack-reuse=[all|named_vars|none] all
-fstdarg-opt [enabled]
-fstore-merging [enabled]
-fstrict-aliasing [enabled]
-fstrict-enums [available in C++,
ObjC++]
-fstrict-volatile-bitfields [enabled]
-fthread-jumps [enabled]
-fno-threadsafe-statics [available in C++,
ObjC++]
-ftoplevel-reorder [enabled]
-ftracer [disabled]
-ftrapping-math [enabled]
-ftrapv [disabled]
-ftree-bit-ccp [enabled]
-ftree-builtin-call-dce [enabled]
-ftree-ccp [enabled]
-ftree-ch [enabled]
-ftree-coalesce-vars [enabled]
-ftree-copy-prop [enabled]
-ftree-cselim [enabled]
-ftree-dce [enabled]
-ftree-dominator-opts [enabled]
-ftree-dse [enabled]
-ftree-forwprop [enabled]
-ftree-fre [enabled]
-ftree-loop-distribute-patterns [enabled]
-ftree-loop-distribution [disabled]
-ftree-loop-if-convert [enabled]
-ftree-loop-im [enabled]
-ftree-loop-ivcanon [enabled]
-ftree-loop-optimize [enabled]
-ftree-loop-vectorize [disabled]
-ftree-lrs [disabled]
-ftree-parallelize-loops=<number> 1
-ftree-partial-pre [disabled]
-ftree-phiprop [enabled]
-ftree-pre [enabled]
-ftree-pta [enabled]
-ftree-reassoc [enabled]
-ftree-scev-cprop [enabled]
-ftree-sink [enabled]
-ftree-slp-vectorize [disabled]
-ftree-slsr [enabled]
-ftree-sra [enabled]
-ftree-switch-conversion [enabled]
-ftree-tail-merge [enabled]
-ftree-ter [enabled]
-ftree-vectorize
-ftree-vrp [enabled]
-funconstrained-commons [disabled]
-funroll-all-loops [disabled]
-funroll-loops [disabled]
-funsafe-math-optimizations [disabled]
-funswitch-loops [disabled]
-funwind-tables [disabled]
-fvar-tracking [enabled]
-fvar-tracking-assignments [enabled]
-fvar-tracking-assignments-toggle [disabled]
-fvar-tracking-uninit [disabled]
-fvariable-expansion-in-unroller [disabled]
-fvect-cost-model=[unlimited|dynamic|cheap] cheap
-fversion-loops-for-strides [disabled]
-fvpt [disabled]
-fweb [enabled]
-fwrapv [disabled]
-fwrapv-pointer [disabled]
I compiled some test cases with -O2, it turns out that 440 files and 167,035 lines of GCC source code were covered.
But when I concatenated every enabled flag into a string S and replace -O2 with S when compiling the same test cases, I found only 390 files and 90,385 lines were covered.
Can someone tell me why? I suspect there is some mechanism in GCC that makes S and -O2 behave very different.

Related

libopenssl building error | make error with Buildroot

I am facing an issue while using Bootlin Toolchain in Buildroot. I am using aarch64 glibc stable 2020.08-1 I get below errors related to libopenssl:
libopenssl 1.1.1m Building
PATH="/root/raspcm4/sources/output/host/bin:/root/raspcm4/sources/output/host/sbin:/root/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" /usr/bin/make -j9 -C /root/raspcm4/sources/output/build/libopenssl-1.1.1m
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/crypto/bn_conf.h.in > include/crypto/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/crypto/dso_conf.h.in > include/crypto/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
/usr/bin/make depend && /usr/bin/make _all
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/app_rand.o apps/app_rand.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF apps/apps.d.tmp -MT apps/apps.o -c -o apps/apps.o apps/apps.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF apps/bf_prefix.d.tmp -MT apps/bf_prefix.o -c -o apps/bf_prefix.o apps/bf_prefix.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF apps/opt.d.tmp -MT apps/opt.o -c -o apps/opt.o apps/opt.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF apps/s_cb.d.tmp -MT apps/s_cb.o -c -o apps/s_cb.o apps/s_cb.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF apps/s_socket.d.tmp -MT apps/s_socket.o -c -o apps/s_socket.o apps/s_socket.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_cbc.d.tmp -MT crypto/aes/aes_cbc.o -c -o crypto/aes/aes_cbc.o crypto/aes/aes_cbc.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_cfb.d.tmp -MT crypto/aes/aes_cfb.o -c -o crypto/aes/aes_cfb.o crypto/aes/aes_cfb.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_core.d.tmp -MT crypto/aes/aes_core.o -c -o crypto/aes/aes_core.o crypto/aes/aes_core.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_ecb.d.tmp -MT crypto/aes/aes_ecb.o -c -o crypto/aes/aes_ecb.o crypto/aes/aes_ecb.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_ige.d.tmp -MT crypto/aes/aes_ige.o -c -o crypto/aes/aes_ige.o crypto/aes/aes_ige.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_misc.d.tmp -MT crypto/aes/aes_misc.o -c -o crypto/aes/aes_misc.o crypto/aes/aes_misc.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_ofb.d.tmp -MT crypto/aes/aes_ofb.o -c -o crypto/aes/aes_ofb.o crypto/aes/aes_ofb.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aes/aes_wrap.d.tmp -MT crypto/aes/aes_wrap.o -c -o crypto/aes/aes_wrap.o crypto/aes/aes_wrap.c
CC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc" /usr/bin/perl crypto/aes/asm/aesv8-armx.pl linux64 crypto/aes/aesv8-armx.S
CC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc" /usr/bin/perl crypto/aes/asm/vpaes-armv8.pl linux64 crypto/aes/vpaes-armv8.S
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/aria/aria.d.tmp -MT crypto/aria/aria.o -c -o crypto/aria/aria.o crypto/aria/aria.c
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:30,
from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /root/raspcm4/sources/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/stdlib.h:394,
from apps/s_socket.c:12:
apps/s_socket.c: In function 'do_server':
apps/s_socket.c:377:17: error: impossible constraint in 'asm'
377 | FD_ZERO(&readfds);
| ^~~~~~~
CC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc" /usr/bin/perl crypto/arm64cpuid.pl linux64 crypto/arm64cpuid.S
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/armcap.d.tmp -MT crypto/armcap.o -c -o crypto/armcap.o crypto/armcap.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/asn1/a_bitstr.d.tmp -MT crypto/asn1/a_bitstr.o -c -o crypto/asn1/a_bitstr.o crypto/asn1/a_bitstr.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/asn1/a_d2i_fp.d.tmp -MT crypto/asn1/a_d2i_fp.o -c -o crypto/asn1/a_d2i_fp.o crypto/asn1/a_d2i_fp.c
/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc -I. -Iinclude -fPIC -pthread -Wa,--noexecstack -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -g0 -D_FORTIFY_SOURCE=1 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MMD -MF crypto/asn1/a_digest.d.tmp -MT crypto/asn1/a_digest.o -c -o crypto/asn1/a_digest.o crypto/asn1/a_digest.c
make[3]: *** [Makefile:737: apps/s_socket.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:30,
from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /root/raspcm4/sources/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/stdlib.h:394,
from apps/apps.c:19:
apps/apps.c: In function 'wait_for_async':
apps/apps.c:2707:5: error: impossible constraint in 'asm'
2707 | FD_ZERO(&asyncfds);
| ^~~~~~~
make[3]: *** [Makefile:705: apps/apps.o] Error 1
make[2]: *** [Makefile:174: all] Error 2
make[1]: *** [package/pkg-generic.mk:295: /root/raspcm4/sources/output/build/libopenssl-1.1.1m/.stamp_built] Error 2
make: *** [Makefile:23: _all] Error 2
This is the menuconfig:
Can anyone please let me know what this is about and how to resolve it?
Your help will be much appreciated.
I could resolve the issue with properly setting the PATH variable. And also you can make the changes permanent by including them in .bashrc file which will be sourced on each login of the console. For example, in .bashrc include
export PATH="$PATH :path/to/bin"

MAC M1 ARM Core - Ruby and Gem pg installation issues

Just wanted to post a question I am facing issues installing gem install pg -v '0.21.0' for 2 projects in my system which is an M1 Mac, has anyone faced issues like this
This is the error I am getting
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
> *** extconf.rb failed ***
Postgres is installed via Homebrew and libpq is also installed, I tried to point to the libpq when gem pg is being installed and try and fix the problem but that is not working too attaching the mkmf log for more details on the error and FYI Postgres is installed and I can also connect to it via terminal and other software. I tried a lot of answers from stack to no avail I am pretty new to Ruby and MAC any help will be great
More info but not sure if relevant had issues installing ruby versions 2.5.0 and 2.3.6 but that is now fixed (was showing as broken earlier so purged it and installed again after manually configuring openssl#1.0 to MAC) but when it was broken both pg and bundle install worked fine for one of my project but the Ruby 2.3.6 version failed to install
EDIT 1
ruby -v
ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-darwin20]
which ruby
/Users/akshayvenugopal/.rvm/rubies/ruby-2.3.6/bin/ruby
rvm list
=* ruby-2.3.6 [ x86_64 ]
ruby-2.5.0 [ x86_64 ]
which openssl
/usr/local/opt/openssl#1.0/bin/openssl
postgres --version
postgres (PostgreSQL) 14.0
EDIT 2
have also had issues with nokogiri not sure if that's the issue
Let me know if you need anymore info any assistance will be greatly appreciated
MKMF Log
find_executable: checking for pg_config... -------------------- yes
--------------------
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -lruby.2.5.0 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -lruby.2.5.0 -Wl,-rpath,/opt/homebrew/opt/libpq/lib -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
find_header: checking for libpq-fe.h... -------------------- yes
"gcc -E -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
/* end */
--------------------
find_header: checking for libpq/libpq-fs.h... -------------------- yes
"gcc -E -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq/libpq-fs.h>
/* end */
--------------------
find_header: checking for pg_config_manual.h... -------------------- yes
"gcc -E -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <pg_config_manual.h>
/* end */
--------------------
have_library: checking for PQconnectdb() in -lpq... -------------------- no
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -Wl,-rpath,/opt/homebrew/opt/libpq/lib -lruby.2.5.0 -lpq -lpthread -ldl -lobjc "
ld: warning: ignoring file /opt/homebrew/opt/libpq/lib/libpq.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
"_PQconnectdb", referenced from:
_t in conftest-f3b0c7.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return !p; }
/* end */
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -Wl,-rpath,/opt/homebrew/opt/libpq/lib -lruby.2.5.0 -lpq -lpthread -ldl -lobjc "
conftest.c:15:13: error: conflicting types for 'PQconnectdb'
extern void PQconnectdb();
^
/opt/homebrew/opt/libpq/include/libpq-fe.h:285:16: note: previous declaration is here
extern PGconn *PQconnectdb(const char *conninfo);
^
conftest.c:16:27: error: too few arguments to function call, single argument 'conninfo' was not specified
int t(void) { PQconnectdb(); return 0; }
~~~~~~~~~~~ ^
/opt/homebrew/opt/libpq/include/libpq-fe.h:285:16: note: 'PQconnectdb' declared here
extern PGconn *PQconnectdb(const char *conninfo);
^
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: extern void PQconnectdb();
16: int t(void) { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -llibpq... -------------------- no
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -Wl,-rpath,/opt/homebrew/opt/libpq/lib -lruby.2.5.0 -llibpq -lpthread -ldl -lobjc "
ld: library not found for -llibpq
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return !p; }
/* end */
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -Wl,-rpath,/opt/homebrew/opt/libpq/lib -lruby.2.5.0 -llibpq -lpthread -ldl -lobjc "
conftest.c:15:13: error: conflicting types for 'PQconnectdb'
extern void PQconnectdb();
^
/opt/homebrew/opt/libpq/include/libpq-fe.h:285:16: note: previous declaration is here
extern PGconn *PQconnectdb(const char *conninfo);
^
conftest.c:16:27: error: too few arguments to function call, single argument 'conninfo' was not specified
int t(void) { PQconnectdb(); return 0; }
~~~~~~~~~~~ ^
/opt/homebrew/opt/libpq/include/libpq-fe.h:285:16: note: 'PQconnectdb' declared here
extern PGconn *PQconnectdb(const char *conninfo);
^
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: extern void PQconnectdb();
16: int t(void) { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -Wl,-rpath,/opt/homebrew/opt/libpq/lib -lruby.2.5.0 -lms/libpq -lpthread -ldl -lobjc "
ld: library not found for -lms/libpq
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return !p; }
/* end */
"gcc -o conftest -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/x86_64-darwin20 -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/backward -I/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/include/ruby-2.5.0 -I. -I/opt/homebrew/opt/libpq/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/akshayvenugopal/.rvm/rubies/ruby-2.5.0/lib -L/opt/homebrew/opt/libpq/lib -L. -fstack-protector -Wl,-rpath,/opt/homebrew/opt/libpq/lib -lruby.2.5.0 -lms/libpq -lpthread -ldl -lobjc "
conftest.c:15:13: error: conflicting types for 'PQconnectdb'
extern void PQconnectdb();
^
/opt/homebrew/opt/libpq/include/libpq-fe.h:285:16: note: previous declaration is here
extern PGconn *PQconnectdb(const char *conninfo);
^
conftest.c:16:27: error: too few arguments to function call, single argument 'conninfo' was not specified
int t(void) { PQconnectdb(); return 0; }
~~~~~~~~~~~ ^
/opt/homebrew/opt/libpq/include/libpq-fe.h:285:16: note: 'PQconnectdb' declared here
extern PGconn *PQconnectdb(const char *conninfo);
^
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: extern void PQconnectdb();
16: int t(void) { PQconnectdb(); return 0; }
/* end */
--------------------

fatal error 'GL/glx.h' file not found on mac after Xquartz is installed

When i run the program i get the following error
fatal error: 'Gl/glx.h' file not found
I am attempting to run a c++ xll graphics program on my mac. I have already downloaded Xquartz and used it to run multiple graphics programs on my computer and now i am trying to figure out what i'm missing in order to get this program to run. if anybody can point me in the right direction it would be wonderful!
Thanks
here is a copy of the make file provided
1 ## If you receive XRR errors, include -lXrandr option on LFLAGS line
2 all: atrace
3 ##LIB = ./libggfonts.so
4 LIB = ./libggfonts.a
5 LFLAGS = -lX11 -lGLU -lGL -lm #-lXrandr
6 CFLAGS = -O2 -Wall -Wextra
7 SOURCE = atrace.cpp init.cpp scene.cpp render.cpp sphere.cpp ppm.cpp log.cpp \
8 vector.cpp input.cpp files.cpp perlin.cpp texture.cpp divide.cpp \
9 cubemap.cpp matrix.cpp fresnel.cpp haze.cpp animate.cpp \
10 photons.cpp subsurf.cpp
11
12 #all: atrace atrace.o init.o scene.o render.o sphere.o ppm.o log.o \
13 # vector.o input.o files.o perlin.o texture.o divide.o \
14 # cubemap.o matrix.o fresnel.o haze.o animate.o
15 #
16 #atrace: $(SOURCE) fonts.h defs.h ppm.h extern.h bvh.h animate.h $(LIB)
17 # g++ $(CFLAGS) $(SOURCE) $(LFLAGS) $(LIB) -o atrace
18
19 atrace: atrace.o init.o scene.o render.o sphere.o ppm.o log.o \
20 vector.o input.o files.o perlin.o texture.o divide.o \
21 cubemap.o matrix.o fresnel.o haze.o animate.o photons.o subsurf.o \
22 defs.h ppm.h extern.h bvh.h animate.h
23 g++ atrace.o init.o scene.o render.o sphere.o ppm.o log.o vector.o \
24 input.o files.o perlin.o texture.o divide.o cubemap.o matrix.o fresnel.o \
25 haze.o animate.o photons.o subsurf.o $(LIB) -oatrace $(LFLAGS)
26
27
28 atrace.o: atrace.cpp defs.h ppm.h extern.h bvh.h animate.h
29 g++ atrace.cpp -c $(CFLAGS) $(LFLAGS)
30 init.o: init.cpp defs.h
31 g++ init.cpp -c $(CFLAGS) $(LFLAGS)
32 scene.o: scene.cpp defs.h
33 g++ scene.cpp -c $(CFLAGS) $(LFLAGS)
34 render.o: render.cpp defs.h
35 g++ render.cpp -c $(CFLAGS) $(LFLAGS)
36 sphere.o: sphere.cpp defs.h
37 g++ sphere.cpp -c $(CFLAGS) $(LFLAGS)
38 ppm.o: ppm.cpp defs.h ppm.h
39 g++ ppm.cpp -c $(CFLAGS) $(LFLAGS)
40 log.o: log.cpp defs.h
41 g++ log.cpp -c $(CFLAGS) $(LFLAGS)
42 vector.o: vector.cpp defs.h
43 g++ vector.cpp -c $(CFLAGS) $(LFLAGS)
44 input.o: input.cpp defs.h
45 g++ input.cpp -c $(CFLAGS) $(LFLAGS)
46 files.o: files.cpp defs.h files.h
47 g++ files.cpp -c $(CFLAGS) $(LFLAGS)
48 perlin.o: perlin.cpp defs.h
49 g++ perlin.cpp -c $(CFLAGS) $(LFLAGS)
50 texture.o: texture.cpp defs.h
51 g++ texture.cpp -c $(CFLAGS) $(LFLAGS)
52 divide.o: divide.cpp defs.h bvh.h
53 g++ divide.cpp -c $(CFLAGS) $(LFLAGS)
54 cubemap.o: cubemap.cpp defs.h
55 g++ cubemap.cpp -c $(CFLAGS) $(LFLAGS)
56 matrix.o: matrix.cpp defs.h
57 g++ matrix.cpp -c $(CFLAGS) $(LFLAGS)
58 fresnel.o: fresnel.cpp defs.h
59 g++ fresnel.cpp -c $(CFLAGS) $(LFLAGS)
60 haze.o: haze.cpp defs.h
61 g++ haze.cpp -c $(CFLAGS) $(LFLAGS)
62 animate.o: animate.cpp defs.h animate.h ppm.h
63 g++ animate.cpp -c $(CFLAGS) $(LFLAGS)
64 photons.o: photons.cpp defs.h
65 g++ photons.cpp -c $(CFLAGS) $(LFLAGS)
66 subsurf.o: subsurf.cpp defs.h
67 g++ subsurf.cpp -c $(CFLAGS) $(LFLAGS)
68
69 clean:
70 rm -f atrace
71 rm -f *.o
Updated Make file still getting
fatal error 'GL/glx.h'
picture of updated make file
You need to compile with the option -I/opt/X11/include and link with the options -L/opt/X11/lib -lGL -lX11.

How to build a source code tree using multiple Makefiles

FYI: all work can be seen in the trac repo # http://matthewh.me/scripts/browser/c/shared_library?order=name
The original post was to long. It essentially asked why my Makefiles were not finding any of the source when building from the root directory.
UPDATE:
I did discover that the paths are all relative to the root directory, regardless of where the makefiles are placed.
I have the libs building now, however I am getting an undefined reference to main when compiling the app.
I will not paste the updated makefiles, but the source tree now looks like:
mehoggan#mehoggan-laptop:~/Code/shared_library$ make
gcc -c -o ./c_lib/c_lib.o ./c_lib/c_lib.c
rm -f ./c_lib/libClib.so.1.0.0 ./c_lib/libClib.so ./c_lib/libClib.so.1 ./c_lib/libClib.so.1.0
gcc -m32 -Wl,-O1 -shared -o ./c_lib/libClib.so.1.0.0 -lpthread
ln -s ./libClib.so.1.0.0 ./c_lib/libClib.so
ln -s ./libClib.so.1.0.0 ./c_lib/libClib.so.1
ln -s ./libClib.so.1.0.0 ./c_lib/libClib.so.1.0
rm -f ./c_lib/libClib.a
ar cqs ./c_lib/libClib.a ./c_lib/c_lib.o
cc -c -m32 -pipe -O2 -Wall -W -D_REENTRANT -I./c_lib/ -o ./app/main.o ./app/main.c
gcc -m32 -Wl,-O1 -o ./app/main.o -L./c_lib/ -lClib
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [app/main] Error 1
mehoggan#mehoggan-laptop:~/Code/shared_library$ ls -lR
.:
total 12
drwxr-xr-x 2 mehoggan mehoggan 4096 2011-11-20 20:23 app
drwxr-xr-x 2 mehoggan mehoggan 4096 2011-11-20 20:23 c_lib
-rw-r--r-- 1 mehoggan mehoggan 824 2011-11-20 19:50 Makefile
./app:
total 8
-rw-r--r-- 1 mehoggan mehoggan 291 2011-11-20 18:52 main.c
-rw-r--r-- 1 mehoggan mehoggan 503 2011-11-20 20:23 Makefile
./c_lib:
total 28
-rw-r--r-- 1 mehoggan mehoggan 245 2011-11-20 18:54 c_lib.c
-rw-r--r-- 1 mehoggan mehoggan 46 2011-11-20 19:53 c_lib.h
-rw-r--r-- 1 mehoggan mehoggan 864 2011-11-20 20:23 c_lib.o
-rw-r--r-- 1 mehoggan mehoggan 1008 2011-11-20 20:23 libClib.a
lrwxrwxrwx 1 mehoggan mehoggan 18 2011-11-20 20:23 libClib.so -> ./libClib.so.1.0.0
lrwxrwxrwx 1 mehoggan mehoggan 18 2011-11-20 20:23 libClib.so.1 -> ./libClib.so.1.0.0
lrwxrwxrwx 1 mehoggan mehoggan 18 2011-11-20 20:23 libClib.so.1.0 -> ./libClib.so.1.0.0
-rwxr-xr-x 1 mehoggan mehoggan 6588 2011-11-20 20:23 libClib.so.1.0.0
-rw-r--r-- 1 mehoggan mehoggan 930 2011-11-20 20:20 Makefile
The contents of main.c are:
#include <stdio.h>
#include "c_lib.h"
int main(int argc, char *argv[])
{
if (argc > 1) {
char *arg = argv[1];
printf("%s\n", arg);
}
char str[12] = "hello world\0";
printf("%s\n", str);
char *rev = reverse(str);
printf("%s\n", rev);
return 1;
}
Why can the compiler not find the main function?
UPDATE
Your fix helped get pass the undefined reference to main, however I am now getting another undefined reference:
[mehoggan#hogganz400 shared_library]$ make
gcc -c -m32 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -I. -o ./c_lib/c_lib.o ./c_lib/c_lib.c
rm -f ./c_lib/libClib.so.1.0.0 ./c_lib/libClib.so ./c_lib/libClib.so.1 ./c_lib/libClib.so.1.0
gcc -m32 -Wl,-O1 -shared -o ./c_lib/libClib.so.1.0.0 -lpthread
ln -s ./libClib.so.1.0.0 ./c_lib/libClib.so
ln -s ./libClib.so.1.0.0 ./c_lib/libClib.so.1
ln -s ./libClib.so.1.0.0 ./c_lib/libClib.so.1.0
rm -f ./c_lib/libClib.a
ar cqs ./c_lib/libClib.a ./c_lib/c_lib.o
gcc -c -m32 -pipe -O2 -Wall -W -D_REENTRANT -I./c_lib/ -o ./app/main.o ./app/main.c
gcc -m32 -Wl,-O1 -o ./app/main -L./c_lib/ -lClib ./app/main.o
./app/main.o: In function `main':
main.c:(.text+0x49): undefined reference to `reverse'
collect2: ld returned 1 exit status
make: *** [app/main] Error 1
Should there be a readable string in the .so file that indicates that reverse is in there?
[mehoggan#hogganz400 shared_library]$ strings ./c_lib/libClib.so.1
__gmon_start__
_init
_fini
__cxa_finalize
_Jv_RegisterClasses
libpthread.so.0
libc.so.6
_edata
__bss_start
_end
GLIBC_2.1.3
gcc -m32 -Wl,-O1 -o ./app/main.o -L./c_lib/ -lClib
You have an error in the variable setting the output file, and the next argument (main.o) is interpreted as the output instead. main.o is thus not loaded and not linked.

bundle install error : character-encodings

I am getting an error while bundle install
$ vi Gemfile
source 'http://rubygems.org'
gem 'daemons'
gem 'rfeedparser'
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
$ bundle install --path vendor
Fetching source index for http://rubygems.org/
Using addressable (2.2.6)
Using cgi_multipart_eof_fix (2.5.0)
Installing character-encodings (0.4.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for ‘-std=c99’ option to compiler... yes
checking for ‘-finline-functions’ option to compiler... yes
checking for ‘-Wall’ option to compiler... yes
checking for ‘-Wextra’ option to compiler... yes
checking for ‘-Wwrite-strings’ option to compiler... yes
checking for ‘-Waggregate-return’ option to compiler... yes
checking for ‘-Wmissing-prototypes’ option to compiler... yes
checking for ‘-Wmissing-declarations’ option to compiler... yes
checking for ‘-Wnested-externs’ option to compiler... yes
checking for ‘-Wundef’ option to compiler... yes
checking for ‘-Wpointer-arith’ option to compiler... yes
checking for ‘-Wcast-align’ option to compiler... yes
checking for ‘-Werror’ option to compiler... yes
checking for ‘-Winline’ option to compiler... yes
checking for assert.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for stdbool.h... yes
checking for stddef.h... yes
checking for stdint.h... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for sys/types.h... yes
checking for wchar.h... yes
creating Makefile
make
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_chomp.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_internal_bignum.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_upcase.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_to_i.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_insert.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_hex.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_each_char.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_justify.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c properties.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c private.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_normalize.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_collate.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_chop.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_count.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_squeeze.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_reverse.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_downcase.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c break.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_index.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c decompose.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_oct.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_rstrip.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_internal_tr.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_rindex.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c unicode.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_aset.c
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline -c rb_utf_tr.c
rb_utf_tr.c: In function ‘tr_trans_do’:
rb_utf_tr.c:107:14: error: variable ‘modified’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make: *** [rb_utf_tr.o] Error 1
Gem files will remain installed in /home/sayuj/work/mobme/vas-vodafone-appsuite/cricket-feeder/vendor/ruby/1.8/gems/character-encodings-0.4.1 for inspection.
Results logged to /home/sayuj/work/mobme/vas-vodafone-appsuite/cricket-feeder/vendor/ruby/1.8/gems/character-encodings-0.4.1/ext/encoding/character/utf-8/gem_make.out
An error occured while installing character-encodings (0.4.1), and Bundler cannot continue.
Make sure that `gem install character-encodings -v '0.4.1'` succeeds before bundling.
Can anyone fix this? thanks!
On Ubuntu 11.10 64bit, try installing
sudo apt-get install libxml-parser-ruby
sudo apt-get install expatxxxx
(where xxxxx is versions like -dev or --dev or 1)
Even if it has not worked try this
gem install rfeedparser -- --with-cflags=\"-O2 -pipe -march=native -Wno-unused-but-set-variable\"

Resources