Repository navigation
[linux-port] GCC compile fixes (#184) - #186
Conversation
|
❌ Build DirectXShaderCompiler 1.0.34 failed (commit cd940dcfec by @pow2clk) |
|
CompileWhenNoMemThenOOM failed again. I think it's an issue with ToT or the build system. |
ehsannas
left a comment
There was a problem hiding this comment.
Great work \o/ Overall, LGTM.
Just two improvements that I think would be nice:
- IMHO it'd be better if your changes in WinMacros.h were in WinSal.h instead (and include WinSal.h instead where needed).
- Please un-comment this line in order to get the Travis gcc bots running again: https://github.com/google/DirectXShaderCompiler/blob/linux/.travis.yml#L19
It'd be exciting to see all Travis Linux bots passing.
You are right about the Windows test failure. It seems that the test is failing in ToT. Sadly I can't reproduce it locally... I'll try to take a closer look at the Windows test failure today.
|
I'm almost completely indifferent to where the changes are. I actually had them in WinSAL originally, but moved them out because they weren't strictly speaking part of SAL and there were other elements in WinMacros that just dummied out what they defined, but I'm equally happy to move them. I'll uncomment the line you said. I had no idea how to change that. Thanks for looking into the windows failure. |
|
❌ Build DirectXShaderCompiler 1.0.36 failed (commit 2866008dd2 by @pow2clk) |
|
I'm seeing several GCC errors that I don't see locally. The version the test system is using seems to be 4.8.4 which is pretty old. I'll see if I can get that version locally so I can at least anticipate such things. On an unrelated note, GCC can colorize output similarly to how clang does. It just doesn't when stdout is redirected as it is with the ninja build system. If there is no objection, I'd like to add the flag so that it will to CMakeLists.txt. That way I won't have to keep adding it locally and we'll get more helpful coloring in the github builds too. |
|
SG to adding more color to the world! ;) |
|
Let's see if we can use a newer GCC version on the bots. |
|
Yeah, Travis CI uses pretty OLD infrastructure. They are still stuck with Ubuntu 14.04, which is 4 years old. Making older compilers happy is a nice thing to achieve, but there is always a line to draw. We cannot go back indefinitely. SO don't stretch yourself too much if using GCC 4.8.4 causing you too much pain. |
|
@ehsannas has given me some things to try to use a newer compiler. It needn't be identical of course, but gcc is kind of notorious for producing a different set of errors with each major version. |
|
sigh Looks like Travis doesn't like the new config file. It seems sane to me... |
|
It did install additional apt packages for later versions of GCC. So it's doing something different. I wonder if the order is a problem. Should the order in the config file matter? I think it should eval the MATRIX_EVAL sooner. I don't know what's going into DXC_BUILD_TYPE to make it fail like it does though. |
|
Okay. Everything WRT gcc actually looks to be ready for success. The problem seems to be that it interprets each of the env settings as a call for a build with just that set and none of the others. Perhaps that's why the guide said to set CC and CXX in a second variable that's evaluated later. I think if we do the same for the DXC_BUILD_TYPE, we'll be in business. So MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && DXC_BUILD_TYPE=Debug" with 3 other variants that swap out the presence of the C* assignments for clang and DX_BUILD_TYPE. I don't know how that will play with the compiler settings though. I think I'm on the right track though. |
|
BTW, the issue with the compilation failures is be that GCC4 only supports C++11 if you ask for it nicely. We aren't asking for it nicely. It was said to be "experimental" anyway. So we probably don't want that. |
|
Yeah, getting the Travis config right is a bit of a trial and error process... Keep throwing different things at it. Thanks 👍 |
|
❌ Build DirectXShaderCompiler 1.0.39 failed (commit 895d076d58 by @pow2clk) |
|
Tested the bash code with single quotes, as it should be, then I implemented it with double. SMH |
|
✅ Build DirectXShaderCompiler 1.0.42 completed (commit f563a3197f by @pow2clk) |
|
Well. The good news is that GCC-6 is being used. The bad news is that it's somehow coming up with a new link error I've not seen involving vtables. The clang eval is failing and I understand why. The early out that prevents the compilers from being misassigned also makes it look like a failure. The debug GCC build is bailing out because the log got too long, but I think that's expected. The log is quite long. Mostly unknown pragma warnings. I think they can be suppressed and I've already added a GCC-specific set of flags to the cmake config file. So I can tack that on. The only mystery is the link error. Don't know why I didn't see it on my machine and I don't know what's causing it. . . .yet. |
|
✅ Build DirectXShaderCompiler 1.0.46 completed (commit 12efd34fa2 by @pow2clk) |
|
GCC Release is completing the test successfully. GCC Debug is still producing too much spew and failing solely for that reason. Clang builds are succeeding as well. Just have to cull down the spew a bit. I'll double check to make sure that locally I'm getting that much from a clean build in case something is awry with the build system. |
|
LGTM. I think you just need to rebase. |
|
Well It's not good really. The spew is too long on one of the GCC builds so it's being marked as a failure. I'm working on that now. |
|
SG. FYI, I just merged #190 , so that should help. Thanks. |
|
It helps, but not enough. I did the same for the last run. Still around 700k over. I have some changes that get it down to 3 megs nearly ready to go. |
|
Feel free to turn of |
|
I'll keep that in arrow in the quiver, but I think I'll have enough by fixing 4 or 5 warnings in popular headers. I measured my own output and found it to be 4.7 MB with only unknown pragmas disabled. With these, it gets down to 2.9 |
GCC doesn't care for calling convention attributes particularly the pervasive __cdecl. GCC has an __attribute__ equivalent, but it doesn't even like its own replacement. So GCC gets nothing. These are stubbed out in WinMacros.h which requires the inclusion of that header in a few more places. GCC has what seems to me to be a bug where it disapproves of the members of a member struct of class OP having the same name as a type imported by "using". It's the only compiler with the issue and I don't see any real conflict, but it's easier to placate it than to fix GCC. GCC claims its ambiguous. Making the member variables lowercase fixes this neatly even if it is GCC being paranoid or buggy. GCC insists on the stdarg.h header to use va_start and friends. HLSL changes excluded Trasnforms/Instrumentation directory entirely including BoundsChecking. However it didn't excluder one reference to a function declared there in BackendUtil that fails to link on GCC. The function that references ther missing BoundsChecking function is static and not used anywhere with current settings. So it's not considered a symbol to be linked by MSVC or clang, but GCC insists. Removed some PointerStatus:: prefixes from references within the class itself which upsets GCC sometimes. Adds color to GCC output even when redirected as is done with ninja. Additional settings in .travis.yml are to induce it to install and use gcc-6. Because the system multiplies the number of compiler variants by the number of env variants and kicks off that many builds and because we only want Debug and Release variants of clang and gcc builds, we have to pack a lot into a deferred eval variable that sets the build type and then changes the compiler variables only if they are GCC types. fixes google#184
|
Travis succeeded across the board. I guess it's still waiting for appveyor? They say "queued". 😞 I think I've addressed @ehsannas earlier comments? |
|
✅ Build DirectXShaderCompiler 1.0.54 completed (commit 9dc078d279 by @pow2clk) |
|
Nice! Thanks Greg. |
GCC doesn't care for calling convention attributes, particularly
the pervasive __cdecl. GCC has an __attribute __ equivalent,
but it doesn't even like its own replacement. So GCC gets nothing.
These are stubbed out in WinMacros.h which requires the inclusion
of that header in a few more places.
GCC has what seems to me to be a bug where it disapproves of the members
of a member struct of class OP having the same name as a type imported
by "using". It's the only compiler with the issue and I don't see any real
conflict, but it's easier to placate it than to fix GCC. GCC
claims its ambiguous. Making the member variables lowercase fixes
this neatly even if it is GCC being paranoid or buggy.
GCC insists on the stdarg.h header to use va_start and friends.
HLSL changes excluded Transforms/Instrumentation directory entirely
including BoundsChecking. However it didn't exclude one reference
to a function declared there in BackendUtil that fails to link on GCC.
The function that references the missing BoundsChecking function
is static and not used anywhere with current settings. So it's not
considered a symbol to be linked by MSVC or clang, but GCC insists.
The referencing function is ifdefed here as it is elsewhere in the same file
and marked as an HLSL change since it should have been part of the original
HLSL work.
fixes #184