|
|
Home » Community » U++ community news and announcements » U++/Win32 is now using CLANG toolchain
Re: U++/Win32 is now using CLANG toolchain [message #53291 is a reply to message #53285] |
Thu, 26 March 2020 16:55 |
Tom1
Messages: 1212 Registered: March 2007
|
Senior Contributor |
|
|
Hi,
One step forward...
when: WIN32 CLANG
Link options: -Xlinker /NODEFAULTLIB:OLDNAMES -Xlinker /NODEFAULTLIB:LIBCMT
This prevents those default libs to be linked.
However, this comes with a price tag:
Linking...
lld-link: error: undefined symbol: __GSHandlerCheck
lld-link: error: undefined symbol: __security_check_cookie
lld-link: error: undefined symbol: __report_rangecheckfailure
lld-link: error: undefined symbol: __chkstk
lld-link: error: undefined symbol: _fltused
lld-link: error: undefined symbol: EnumPrintersA
lld-link: error: undefined symbol: OpenPrinterA
lld-link: error: undefined symbol: SetPrinterA
lld-link: error: undefined symbol: ClosePrinter
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
There were errors. (0:00.61)
Best regards,
Tom
|
|
|
Re: U++/Win32 is now using CLANG toolchain [message #53293 is a reply to message #53291] |
Thu, 26 March 2020 17:26 |
Tom1
Messages: 1212 Registered: March 2007
|
Senior Contributor |
|
|
And here's finally the solution to this game. Had to add fake functions to satisfy the dependencies. I know these functions do not do anything, but I decided not to really need those anyway...
#ifdef __MINGW32__
extern "C"{
void __cdecl __GSHandlerCheck() { }
void __cdecl __security_check_cookie(uintptr_t i) { }
void __cdecl __chkstk() { }
void __cdecl __report_rangecheckfailure() { }
void __cdecl _fltused() { }
WINBOOL WINAPI EnumPrintersA(DWORD Flags,LPSTR Name,DWORD Level,LPBYTE pPrinterEnum,DWORD cbBuf,LPDWORD pcbNeeded,LPDWORD pcReturned) { return false; }
WINBOOL WINAPI OpenPrinterA(LPSTR pPrinterName,LPHANDLE phPrinter,LPPRINTER_DEFAULTSA pDefault) { return false; }
WINBOOL WINAPI SetPrinterA(HANDLE hPrinter,DWORD Level,LPBYTE pPrinter,DWORD Command) { return false; }
WINBOOL WINAPI ClosePrinter(HANDLE hPrinter) { return false; }
}
#endif //__MINGW32__
One more library to go... with a different challenge.
Best regards,
Tom
|
|
|
|
Re: U++/Win32 is now using CLANG toolchain [message #53296 is a reply to message #53295] |
Thu, 26 March 2020 18:57 |
Tom1
Messages: 1212 Registered: March 2007
|
Senior Contributor |
|
|
The above solution is actually easier for me as I do not need to maintain separate dummy empty libs. The lines of code required can be included in the module using the library so it is quite straight forward in this special case.
Thanks and best regards,
Tom
|
|
|
|
Re: U++/Win32 is now using CLANG toolchain [message #54549 is a reply to message #53299] |
Thu, 13 August 2020 12:13 |
Oblivion
Messages: 1093 Registered: August 2007
|
Senior Contributor |
|
|
Hello Mirek,
One problem I've noticed about CLANG on windows: Windows 10 api doesn't seem to be supported by Upp. They cant't be compiled because some of them are conditionally included (ver >= 0x0A00, ver >= 0x0700, etc.)
(I've noticed this while implementing the windows 10 pseudoconsole API support for terminal ctrl.)
The headers, and prototypes are already included in CLANG bundle but It requires manual intervention in Core/config.h to change _WIN32_WINNT from 0x0501 to 0x0A00. (redefining it elsewhere doesn't seem to work either; or at least I couldn't find a simple way)
If I set the version number to 0x0A00 everthing compiles fine on CLANG.
(Also, there is no such problem with MSVC 19. It does not require any intervention.)
Is there a workaround for this problem? (may be a flag in TheIDE's main configuration, etc. ?)
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Thu, 13 August 2020 12:26] Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu May 09 23:58:39 CEST 2024
Total time taken to generate the page: 0.02353 seconds
|
|
|