bitwizeshift / bitwizeshift/Alloy
Fix gcc build on Windows
- Dominant language
- C++
- Stars
- 12
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Checklist
- [x] I did not find a duplicate of this bug in the Github Issues section.
----------
### Description
Since Github migrated to using the `$GITHUB_ENV` environment variable, various
parts of the CI build have had to change in order to build correctly. As part of these
changes, it appears that newer GCC build versions are now failing to build entirely
due to different errors depending on debug or release builds:
#### Debug
```
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\AlloyCoreTest.dir\src\main.cpp.obj: too many sections (32805)
C:\Users\RUNNER~1\AppData\Local\Temp\ccXSuEW8.s: Assembler messages:
C:\Users\RUNNER~1\AppData\Local\Temp\ccXSuEW8.s: Fatal error: can't write 233 bytes to section .text of CMakeFiles\AlloyCoreTest.dir\src\main.cpp.obj: 'File too big'
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\AlloyCoreTest.dir\src\main.cpp.obj: too many sections (32805)
C:\Users\RUNNER~1\AppData\Local\Temp\ccXSuEW8.s: Fatal error: can't close CMakeFiles\AlloyCoreTest.dir\src\main.cpp.obj: File too big
```
[Link](https://github.com/bitwizeshift/Alloy/runs/1629276005)
#### Release
```
In file included from D:/a/Alloy/Alloy/lib/alloy-io/include/alloy/io/events/keyboard_events.hpp:34,
from D:\a\Alloy\Alloy\build\lib\alloy-io\AlloyIO.SelfContainmentTest\include\alloy\io\events\keyboard_events.hpp.cpp:1:
D:/a/Alloy/Alloy/lib/alloy-io/include/alloy/io/event.hpp:519:8: error: 'alloy::io::event::~event()' redeclared without dllimport attribute after being referenced with dll linkage [-Werror]
inline alloy::io::event::~event()
^~~~~
D:/a/Alloy/Alloy/lib/alloy-io/include/alloy/io/event.hpp:617:13: error: 'void alloy::io::event::reset()' redeclared without dllimport attribute after being referenced with dll linkage [-Werror]
inline void alloy::io::event::reset()
^~~~~
D:/a/Alloy/Alloy/lib/alloy-io/include/alloy/io/event.hpp:686:22: error: 'static uint32_t alloy::io::event::null_handler(alloy::io::event::operation, const storage_type*, const storage_type*)' redeclared without dllimport attribute after being referenced with dll linkage [-Werror]
inline std::uint32_t alloy::io::event::null_handler(operation op,
^~~~~
```
This error appears to be due to using the `ALLOY_IO_API` preprocessor symbol on a
class that has inline variables. Brief searching on stack overflow indicates that this
warning from GCC is extraneous and does not affect behavior; however it appears that
this also appears that it cannot simply be suppressed with a `Wno-...` argument since the
`-Werror` message does not indicate what the warning flag is that triggers this error
[Link](https://github.com/bitwizeshift/Alloy/runs/1629276024)
---------
It may just be that the fix to this will simply be to update the minimum GCC version.
It may also be that some small code-changes may be required as well.
#### Expected Behavior
The build succeeds
#### Actual Behavior
The build fails
### Extra information
* Library version: `master`
* Operating System: Microsoft Windows Server 2019 - 10.0.17763
* Compiler: GNU 8.1.0
Contributor guide
Assessment
This issue has not been assessed yet.