I am trying to study different compilation stage from GCC.
Compile stage by stage manually
$ g++ -E main.cpp -o main.i # I1
$ g++ -S main.i -o main.s # S1
$ g++ -S main.i -o main.debug.s -ggdb -g3 # S2
$ as main.s -o main.as.o # O1
$ as main.debug.s -o main.as.debug.o # O2
And compile again with "g++ only" completely
$ g++ -c main.cpp -o main.gcc.o # G1
$ g++ -c main.cpp -o main.gcc.debug.o -ggdb -g3 # G2
At the end
main.as.o is identical with main.gcc.o without debug info
but
main.as.debug.o is very different from main.gcc.debug.o
Why? do I miss anything?
here is the tool version
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++-7
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.2.0/libexec/gcc/x86_64-apple-darwin13.4.0/7.2.0/lto-wrapper
Target: x86_64-apple-darwin13.4.0
Configured with: ../configure --build=x86_64-apple-darwin13.4.0 --prefix=/usr/local/Cellar/gcc/7.2.0 --libdir=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --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 --enable-checking=release --with-pkgversion='Homebrew GCC 7.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 7.2.0 (Homebrew GCC 7.2.0)
$ as -v
Apple Inc version cctools-862, GNU assembler version 1.38
UPDATE
with -v and -save-temps options here shows the equivalent commands
#####
# $ g++ -E main.cpp -o main.i # I1
$ cc1plus -E -quiet -v -D__DYNAMIC__ main.cpp -o main.i -fPIC -mmacosx-version-min=10.9.4 -mtune=core2
#####
# $ g++ -S main.i -o main.s # S1
$ cc1plus -fpreprocessed main.i -fPIC -quiet -dumpbase main.i -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.s -version -fdump-tree-all-graph -o main.s
#####
# $ g++ -S main.i -o main.debug.s -ggdb -g3 # S2
$ cc1plus -fpreprocessed main.i -fPIC -quiet -dumpbase maini -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.debug.s -ggdb -g3 -version -o main.debug.s
#####
$ as main.s -o main.as.o # O1
$ as main.debug.s -o main.as.debug.o # O2
#####
# g++ -c main.cpp -o main.gcc.o # G1
$ cc1plus -E -quiet -v -D__DYNAMIC__ main.cpp -fPIC -mmacosx-version-min=10.9.4 -mtune=core2 -fpch-preprocess -o main.ii
$ cc1plus -fpreprocessed main.ii -fPIC -quiet -dumpbase main.cpp -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.gcc.o -version -o main.s
$ as -arch x86_64 -v -force_cpusubtype_ALL -o main.gcc.o main.s
#####
# g++ -c main.cpp -o main.gcc.debug.o -ggdb -g3 # G2
$ cc1plus -E -quiet -v -dD -D__DYNAMIC__ main.cpp -fPIC -mmacosx-version-min=10.9.4 -mtune=core2 -ggdb -g3 -fworking-directory -fpch-preprocess -o main.ii
$ cc1plus -fpreprocessed main.ii -fPIC -quiet -dumpbase main.cpp -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.gcc.debug.o -ggdb -g3 -version -o main.s
$ as -arch x86_64 -v -force_cpusubtype_ALL -o main.gcc.debug.o main.s
#####
Oooops, it is trivial failure by me.
Original post
$ g++ -E main.cpp -o main.i # I1
$ g++ -S main.i -o main.s # S1
$ g++ -S main.i -o main.debug.s -ggdb -g3 # S2
I need to call -E also with debug options and serve to the next stage....
Should change to...
$ g++ -E main.cpp -o main.debug.i -ggdb -g3 # I2
$ g++ -S main.debug.i -o main.debug.s -ggdb -g3 # S2'
then the following stages will generate same machine code...
Related
I try to compile my written C++ code G++ GMP on Windows. My program works fine on Ubuntu. I need to recompile and build the library with Mingw-G++ to eventually compile my final program with Mingw for Windows.
My problem now:
The configure file provided with the library does not look like it can set Mingw-GCC over GCC as compiler anywhere. You can set flags for build and host type but they don't bring the desired results (in my testing).
Im far from being an expert with makefiles and shell scripts, so it might seem like I can't set the compiler, but I think I just overlook something. I can imagine that i need so set the path to Mingw in the configure file myself, but i dont want to break anything YET.
I figured out that there is a CClist in the configure file, which is set to gcc / gcc icc etc... it determines which list of compilers to set depending on the CPU build type (arm/amd64/etc...).<
Another problem: the mingw gcc compiler on linux isn't named gcc unlike on windows but rather x86_64-w64-mingw32-gcc...so the script can't detect it as gcc
Thanks in advance
Edit
After some help from #SuperStormer i set the compiler as mingw32-gcc correctly as my config.status file show, however make check fails with the following warnings:
z.lo spinner.lo trace.lo ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-ar cq .libs/libtests.a memory.o misc.o refmpf.o refmpn.o refmpq.o refmpz.o spinner.o trace.o
libtool: link: x86_64-w64-mingw32-ranlib .libs/libtests.a
libtool: link: ( cd ".libs" && rm -f "libtests.la" && ln -s "../libtests.la" "libtests.la" )
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-bswap.o t-bswap.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-bswap.exe t-bswap.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-bswap.exe t-bswap.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-constants.o t-constants.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-constants.exe t-constants.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-constants.exe t-constants.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-count_zeros.o t-count_zeros.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-count_zeros.exe t-count_zeros.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-count_zeros.exe t-count_zeros.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-hightomask.o t-hightomask.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-hightomask.exe t-hightomask.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-hightomask.exe t-hightomask.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-modlinv.o t-modlinv.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-modlinv.exe t-modlinv.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-modlinv.exe t-modlinv.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-popc.o t-popc.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-popc.exe t-popc.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-popc.exe t-popc.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-parity.o t-parity.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-parity.exe t-parity.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-parity.exe t-parity.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-sub.o t-sub.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-sub.exe t-sub.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-sub.exe t-sub.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
make[4]: Verzeichnis „/home/me/Downloads/gmp-6.2.1/tests“ wird verlassen
and this
FAIL: t-bswap.exe
FAIL: t-constants.exe
FAIL: t-count_zeros.exe
FAIL: t-hightomask.exe
FAIL: t-modlinv.exe
FAIL: t-popc.exe
FAIL: t-parity.exe
FAIL: t-sub.exe
============================================================================
Testsuite summary for GNU MP 6.2.1
============================================================================
# TOTAL: 8
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 8
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Test-suite-log says: it can't run the .exe file. It's clear to me why it can't, but is there any workaround to create a linux excutable instead? Or is make check expected to fail?
Solution
Quick guess is that make check can't succeed on linux with mingw.
I ran make install, and my program now runs fine (regarding my library issues)
This answer is mostly based on this mailing list post.
Commands ran:
export CC=x86_64-w64-mingw32-gcc
export CC_FOR_BUILD=x86_64-linux-gnu-gcc
./configure --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --enable-cxx
make
Tweak this however you want.
I have the following makefile in my c++ program
#All Targets
all: bin/cTrace
bin/cTrace: bin/main.o bin/agent.o bin/session.o bin/graph.o bin/tree.o
#echo 'Building target: main'
#echo 'Invoking: C++ Linker'
g++ -o bin/cTrace bin/main.o bin/agent.o bin/graph.o bin/tree.o bin/session.o
#echo 'Finished building target: main'
#echo ' '
bin/main.o: src/main.cpp
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/main.o src/main.cpp
bin/agent.o: src/Agent.cpp
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/agent.o src/Agent.cpp
bin/session.o: src/Session.cpp
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/session.o src/Session.cpp
bin/graph.o: src/Graph.cpp
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/graph.o src/Graph.cpp
bin/tree.o: src/Tree.cpp
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/tree.o src/Tree.cpp
but when I write at the terminal: make I get the following message:
'makefile:7 *** missing separator stop'
I have been looking for the problem and I understand that the main cause is that the text editor may change tab to space so I check throughout all my makefile and I hadn't found any problem.
What else can cause it?
edit:
after I compile cat -e -t -v Makefile I get the following result:
spl211#spl211:~/CLionProjects/cTrace$ cat -e -t -v makefile
#All Targets^M$
all: bin/cTrace^M$
^M$
bin/cTrace: bin/main.o bin/agent.o bin/session.o bin/graph.o bin/tree.o^M$
#echo 'Building target: main'^M$
#echo 'Invoking: C++ Linker'^M$
g++ -o bin/cTrace bin/main.o bin/agent.o bin/graph.o bin/tree.o bin/session.o^M$
#echo 'Finished building target: main'^M$
#echo ' '^M$
^M$
bin/main.o: src/main.cpp^M$
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/main.o src/main.cpp^M$
^M$
bin/agent.o: src/Agent.cpp^M$
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/agent.o src/Agent.cpp^M$
^M$
bin/session.o: src/Session.cpp^M$
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/session.o src/Session.cpp^M$
^M$
bin/graph.o: src/Graph.cpp^M$
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/graph.o src/Graph.cpp^M$
^M$
bin/tree.o: src/Tree.cpp^M$
g++ -g -Wall -Weffc++ -std=c++11 -c -Iinclude -o bin/tree.o src/Tree.cpp
I'm getting errors when trying to run the HTTP server example that comes with the source of the boost library, under the path: boost_1_59_0/libs/asio/example/cpp11/http/server/.
I already ran this following commands in the boost_1_59_0 directory:
$ ./bootstrap.sh
$ sudo ./bjam install
$ sudo ./b2 install
After installing all targets, i tried to compile the main.cpp and the server.cpp with this command: g++ -std=c++0x -o main main.cpp -I "/home/user/Desktop/boost_1_59_0" -L "/home/user/Desktop/boost_1_59_0/libs/" -lboost_system.
Any suggestion on how to compile this server example?
I linked all files from the boost_1_59_0/libs/asio/example/cpp11/http/server/ folder after the main.cpp, as #Richard Hodges suggested. It still didn't work, i got errors concerning lpthread, so i added it to the compiling options. The program compiled but it failed the execution, returning an error saying that it didn't find the library libboost_system.so.1.59.0. I tried linking the folders with -L /path/to/library but it didn't work.
Solution:
My compilation command:
g++ -std=gnu++0x -o main main.cpp server.cpp connection.cpp connection_manager.cpp reply.cpp mime_types.cpp request_handler.cpp request_parser.cpp -I "/home/user/Desktop/boost_1_59_0" -lboost_system -lpthread
I solved it with this commands:
$ LD_LIBRARY_PATH="/usr/local/lib/"
$ sudo ldconfig
And then I just ran the executable and it worked!
Here's a simple makefile I just concocted that works:
all:server
CPPFLAGS+=-std=c++11 -Wall -pedantic
CPPFLAGS+=-g -O2
CPPFLAGS+=-pthread
LDFLAGS+=-lboost_system
%.o:%.cpp
$(CXX) $(CPPFLAGS) $^ -c -o $#
server:$(patsubst %.cpp,%.o,$(wildcard *.cpp))
$(CXX) $(CPPFLAGS) $^ -o $# $(LDFLAGS)
It runs make:
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread connection.cpp -c -o connection.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread connection_manager.cpp -c -o connection_manager.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread main.cpp -c -o main.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread mime_types.cpp -c -o mime_types.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread reply.cpp -c -o reply.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread request_handler.cpp -c -o request_handler.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread request_parser.cpp -c -o request_parser.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread server.cpp -c -o server.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread connection.o connection_manager.o main.o mime_types.o reply.o request_handler.o request_parser.o server.o -o server -lboost_system
And the test program runs:
$ ./server 0.0.0.0 9889 . &
$ GET http://localhost:9889/main.cpp > main.cpp.0
Check the files
$ md5sum main.cpp*
be5dc1c26b5942101a7895de6baedcee main.cpp
be5dc1c26b5942101a7895de6baedcee main.cpp.0
Don't forget to kill the server when you're done
I have both a default C/C++ tool set (gcc 4.8) and have recently built and installed 5.2 in its own directory. I want to build some C++ programs using a makefile that uses CC and CXX explicity to compile but uses the implicit built-in rule to link the .o files to build the executable.
When I run make on the makefile, I use the command
make all CC=/usr/gcc-5.2.0/bin/gcc-5.2.0 CXX=/usr/gcc-5.2.0/bin/g++-5.2.0
The compile steps all use the 5.2 compilers but when the executable is build, the default g++ is used to link everything. Now, this happens to work and the results run but it isn't what I want. I tried adding
LD=/usr/gcc-5.2.0/bin/g++-5.2.0
to the make command line but LD is ignored. Without changing the makefile, how can I get the link step to use the 5.2 compiler?
Here is the make file:
CPPFLAGS = -Wall
LDFLAGS = -lstdc++
CXX = g++
CC = g++
all: TestSHA3 HashSHA3 HashZeroBytes LongTest sha3sum
debug: override CPPFLAGS += -ggdb
debug: all
SHA3-o3:
$(CXX) $(CPPFLAGS) -O3 -c -o SHA3.o SHA3.cpp
o3: SHA3-o3 all
TestSHA3: TestSHA3.o SHA3.o
HashSHA3: HashSHA3.o SHA3.o
HashZeroBytes: HashZeroBytes.o SHA3.o
LongTest: LongTest.o SHA3.o
sha3sum: sha3sum.o SHA3.o
.PHONY: clean realclean rc debug all o3 SHA3-o3
clean:
rm SHA3.o TestSHA3.o HashSHA3.o HashZeroBytes.o LongTest.o sha3sum.o
rc: realclean
realclean: clean
rm TestSHA3 HashSHA3 HashZeroBytes LongTest sha3sum
Here is the command:
make all CXX=g++-5.2.0 LD=g++-5.2.0
And here are the results of the make:
g++-5.2.0 -Wall -c -o TestSHA3.o TestSHA3.cpp
g++-5.2.0 -Wall -c -o SHA3.o SHA3.cpp
g++ -lstdc++ TestSHA3.o SHA3.o -o TestSHA3
g++-5.2.0 -Wall -c -o HashSHA3.o HashSHA3.cpp
g++ -lstdc++ HashSHA3.o SHA3.o -o HashSHA3
g++-5.2.0 -Wall -c -o HashZeroBytes.o HashZeroBytes.cpp
g++ -lstdc++ HashZeroBytes.o SHA3.o -o HashZeroBytes
g++-5.2.0 -Wall -c -o LongTest.o LongTest.cpp
g++ -lstdc++ LongTest.o SHA3.o -o LongTest
g++-5.2.0 -Wall -c -o sha3sum.o sha3sum.cpp
g++ -lstdc++ sha3sum.o SHA3.o -o sha3sum
Use:
make all CXX=g++-5.2.0 CC=g++-5.2.0
The implicit rule for linking uses CC (make manual):
n is made automatically from n.o by running the linker (usually called
ld) via the C compiler. The precise recipe used is ‘$(CC) $(LDFLAGS)
n.o $(LOADLIBES) $(LDLIBS)’.
With your Makefile and dummy source files:
$ make all CXX=`which g++`
/usr/bin/g++ -Wall -c -o TestSHA3.o TestSHA3.cpp
/usr/bin/g++ -Wall -c -o SHA3.o SHA3.cpp
g++ -lstdc++ TestSHA3.o SHA3.o -o TestSHA3
/usr/bin/g++ -Wall -c -o HashSHA3.o HashSHA3.cpp
g++ -lstdc++ HashSHA3.o SHA3.o -o HashSHA3
/usr/bin/g++ -Wall -c -o HashZeroBytes.o HashZeroBytes.cpp
g++ -lstdc++ HashZeroBytes.o SHA3.o -o HashZeroBytes
/usr/bin/g++ -Wall -c -o LongTest.o LongTest.cpp
g++ -lstdc++ LongTest.o SHA3.o -o LongTest
/usr/bin/g++ -Wall -c -o sha3sum.o sha3sum.cpp
g++ -lstdc++ sha3sum.o SHA3.o -o sha3sum
$ make all CC=`which g++`
g++ -Wall -c -o TestSHA3.o TestSHA3.cpp
g++ -Wall -c -o SHA3.o SHA3.cpp
/usr/bin/g++ -lstdc++ TestSHA3.o SHA3.o -o TestSHA3
g++ -Wall -c -o HashSHA3.o HashSHA3.cpp
/usr/bin/g++ -lstdc++ HashSHA3.o SHA3.o -o HashSHA3
g++ -Wall -c -o HashZeroBytes.o HashZeroBytes.cpp
/usr/bin/g++ -lstdc++ HashZeroBytes.o SHA3.o -o HashZeroBytes
g++ -Wall -c -o LongTest.o LongTest.cpp
/usr/bin/g++ -lstdc++ LongTest.o SHA3.o -o LongTest
g++ -Wall -c -o sha3sum.o sha3sum.cpp
/usr/bin/g++ -lstdc++ sha3sum.o SHA3.o -o sha3sum
$ make all CC=`which g++` CXX=`which g++`
/usr/bin/g++ -Wall -c -o TestSHA3.o TestSHA3.cpp
/usr/bin/g++ -Wall -c -o SHA3.o SHA3.cpp
/usr/bin/g++ -lstdc++ TestSHA3.o SHA3.o -o TestSHA3
/usr/bin/g++ -Wall -c -o HashSHA3.o HashSHA3.cpp
/usr/bin/g++ -lstdc++ HashSHA3.o SHA3.o -o HashSHA3
/usr/bin/g++ -Wall -c -o HashZeroBytes.o HashZeroBytes.cpp
/usr/bin/g++ -lstdc++ HashZeroBytes.o SHA3.o -o HashZeroBytes
/usr/bin/g++ -Wall -c -o LongTest.o LongTest.cpp
/usr/bin/g++ -lstdc++ LongTest.o SHA3.o -o LongTest
/usr/bin/g++ -Wall -c -o sha3sum.o sha3sum.cpp
/usr/bin/g++ -lstdc++ sha3sum.o SHA3.o -o sha3sum
Trying to compile tree from here (i uncommented appropriate section for cygwin in make script):
http://mama.indstate.edu/users/ice/tree/
$ make
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o tree.o tree.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o unix.o unix.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o html.o html.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o xml.o xml.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o hash.o hash.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o color.o color.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o strverscmp.o strverscmp.c
gcc -s -o tree.exe tree.o unix.o html.o xml.o hash.o color.o strverscmp.o
$ make install
install -d /usr/bin
install -d /usr/man/man1
if [ -e tree.exe ]; then \
install -s tree.exe /usr/bin/tree.exe; \
fi
install doc/tree.1 /usr/man/man1/tree.1
When i try to run however crickets
No output, no error, nothing. I'm using this compiler (running on 64bit cygwin):
/usr/bin/gcc -> i686-pc-cygwin-gcc.exe
What am i doing wrong, how can i resolve?
EDIT:
More on crickets:
i checked return code (echo $?) and it's 127
However, i also did
$ ls /usr/bin | grep tree
tree.exe