Fix TOOLCHAIN generation for cross builds and exampleApp on GCC 8#16
Conversation
* use CCC instead of CXX * Link against libstdc++fs as needed for the example app
|
|
||
| TOOLCHAIN: toolchain.cpp | ||
| $(CXX) -E $< | grep '^LINSTAT_' > $@ | ||
| $(CCC) -E $< | grep '^LINSTAT_' > $@ |
There was a problem hiding this comment.
Right. CXX is a builtin from Make. Well spotted. It really is too bad Make does not provide a way for a Makefile to disable the builtin rules and variables.
With PVXS I used CPP, but that would expand to $(CC) -x c -E. The selection of -x c does not work here. So CCC seems the way to go.
| ifeq (YES,$(LINSTAT_NEED_STDCXXFS)) | ||
| # see configure/toolchain.cpp | ||
| PROD_SYS_LIBS += stdc++fs | ||
| endif | ||
|
|
There was a problem hiding this comment.
Are you having to encode this in your IOC applications?
fyi. alternatives include what PVXS does to inject a dependency on libevent. This case would be simpler since, when needed, the library is always in the system search path. Or just to replace usage of std::filesystem. It is not that difficult to iterate the contents of a directory (opendir()).
There was a problem hiding this comment.
Yeah I am having to add this. the target I'm building for enables only static libraries, the issue may not be present with shared objects.
EPICS has the strange
CCCvariable instead ofCXX. I was getting linker errors using GCC 8.3.0 for a cross target because it was checking the libstdc++ version from my host system's compiler.Also links the exampleApp against libstdc++fs, since that was also generating linker errors. Uses the same snippets that
statApp/src/Makefileuses.