Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

Assembler test fails for 32-bit x86 target on 64-bit host #1962

Closed
puleglot opened this issue Jul 23, 2017 · 9 comments
Closed

Assembler test fails for 32-bit x86 target on 64-bit host #1962

puleglot opened this issue Jul 23, 2017 · 9 comments
Assignees
Milestone

Comments

@puleglot
Copy link

Recently introduced try_compile test (a710032) doesn't work for 32-bit x86 target on 64-bit host. I export "ASFLAGS=--32" variable, "--32" is being added to the linker flags and test fails.

.....
-- The ASM-ATT compiler identification is GNU
-- Found assembler: /usr/bin/as
CMake Warning at loader/CMakeLists.txt:122 (message):
  Could not find working x86 GAS assembler

  The build will fall back on building with C code

  Note that this may be unsafe, as the C code requires tail-call
  optimizations to remove the stack frame for certain calls.  If the compiler
  does not do this, then unknown device extensions will suffer from a
  corrupted stack.
.....

With --debug-trycompile cmake option I get this:

# pwd
/var/tmp/portage/media-libs/vulkan-loader-1.0.54.0-r1/work/Vulkan-LoaderAndValidationLayers-sdk-1.0.54.0-abi_x86_32.x86/loader/CMakeFiles/CMakeTmp
# cat CMakeFiles/cmTC_12db8.dir/link.txt
/usr/bin/ld  --32 -I"/var/tmp/portage/media-libs/vulkan-loader-1.0.54.0-r1/work/Vulkan-LoaderAndValidationLayers-sdk-1.0.54.0-abi_x86_32.x86/loader"     CMakeFiles/cmTC_12db8.dir/asm_test.asm.o  -o cmTC_12db8
# /usr/bin/ld  --32 -I"/var/tmp/portage/media-libs/vulkan-loader-1.0.54.0-r1/work/Vulkan-LoaderAndValidationLayers-sdk-1.0.54.0-abi_x86_32.x86/loader"     CMakeFiles/cmTC_12db8.dir/asm_test.asm.o  -o cmTC_12db8
/usr/bin/ld: unrecognized option '--32'
/usr/bin/ld: use the --help option for usage information
#

My cmake version: 3.7.2.

@johnzupin
Copy link
Contributor

Looks like the CMAKE_ASM-ATT_FLAGS variables in loader/CMakeList.txt needs to be cached.

I'm doing some more testing and will create a pull request today.

@johnzupin
Copy link
Contributor

I don't think this was a fix actually, still looking for solutions...

@ikelos
Copy link

ikelos commented Oct 4, 2017

This has been reported to Gentoo as bug 625844. They report that this is an issue in 1.0.54.0 and is still present in 1.0.61.1. I'm sure there would be some users on there happy to help test out potential patches if that would help?

@ikelos
Copy link

ikelos commented Nov 24, 2017

@johnzupin I was wondering how finding a solution for this has been going?

@johnzupin
Copy link
Contributor

@lenny-lunarg: Can you review my fix when you get in on next week please.

@johnzupin
Copy link
Contributor

@lenny-lunarg

@lenny-lunarg
Copy link
Contributor

This should now be resolved with commit 488a6ea. The problem was that the try_compile test was also attempting to link with the --32 argument. This should now be resolved.

@saboya
Copy link

saboya commented Mar 3, 2018

Should this work when backported to 1.0.61.1? Tried it on Gentoo and it didn't work for me.

@chewi
Copy link
Contributor

chewi commented Mar 3, 2018

@saboya, this commit only addresses part of the problem on Gentoo. An eclass change will deal with the rest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants