-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
´Use g++ and clang++ instead of gcc and clang as C++ compilers #4234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang++
is not a linker, it is a compiler driver, so it should not be used in the $(LD)
variable. Either put a linker (ld
, lld
, etc) in $(LD)
or remove $(LD)
altogether and change $(LDFLAGS)
to $(LINKFLAGS)
or something.
It seems that clang++ or g++ can be used as the linker, specially if sanitizers are used: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#usage. I think it is not viable to use ld, because -rdynamic is supported in g++ and clang++ and not in ld, if I am not mistaken. |
…-> LINKFLAGS. CXX is clang++ or g++, not clang and gcc
That is possible. In that case you should remove |
Done. I had to change $LD for $CXX in passes/techmap/Makefile.inc, otherwise we would get the same linking error
|
Looks better, thank you. Now that we don't have It looks like we have a bunch of |
Done. I had to fix it in other Makefiles too. Now two tests fail
I have reproduced the error locally by running: I get the following error:
I am a bit lost as to how to debug that failure. |
Those happen to be the only CI jobs which run the testsuite (through Looks like the fault is in |
misc/yosys-config.in
Outdated
echo " --ldflags @LINKFLAGS@" | ||
echo " --ldlibs @LIBS@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rename them here as well, while providing compatibility:
echo " --ldflags @LINKFLAGS@" | |
echo " --ldlibs @LIBS@" | |
echo " --linkflags @LINKFLAGS@" | |
echo " --ldflags (alias of --linkflags) | |
echo " --linklibs @LIBS@" | |
echo " --ldlibs (alias of --linklibs) |
CXXFLAGS = -MD -Wall -Wextra -ggdb | ||
CXXFLAGS += -std=c++11 -O0 | ||
LDLIBS = ../minisat/Options.cc ../minisat/SimpSolver.cc ../minisat/Solver.cc ../minisat/System.cc -lm -lstdc++ | ||
LIBS = ../minisat/Options.cc ../minisat/SimpSolver.cc ../minisat/Solver.cc ../minisat/System.cc -lm -lstdc++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a completely unhinged definition of LIBS
.
(I am not asking you to fix it; I am just stating my bewilderment.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you a lot! The Makefiles are not perfect but they are at least not blatantly misleading anymore, so we are getting somewhere!!
Thank you for your patience and handholding! |
This would solve the CXX and LD points of #2011.
LD is also changed to g++ when appropriate.
All pipelines pass in my fork (https://github.com/RCoeurjoly/yosys/actions).