MantisBT - CMake
View Issue Details
0015973CMakeCMakepublic2016-02-13 18:112016-06-10 14:31
Paweł Stankowski 
Kitware Robot 
normaltrivialalways
closedmoved 
CMake 3.0.2 
 
0015973: ASM-ATT: cannot set assembler using environment variable
Environment variable cannot be used for ATT dialect, because it contains dash in this variable's name ("ASM-ATT"). Bash and other shells won't parse assignment to variable containing such sign. There is an ugly workaround, though:
env 'ASM-ATT=~/bin/i386-linux-as' cmake ../src

CMakeDetermineASMCompiler.cmake checks for existance of environment variable ASM${ASM_DIALECT} at the early phase of lookup.

This works nicely for NASM and MASM assemblers, because they use underscore instead of dash (ASM_NASM, ASM_MASM).
1. Install two gas assemblers: in system and other directory.
2. In a build directory try to point cmake to the non-default assembler:
env 'ASM-ATT=<PATH-TO-OTHER-ASSEMBLER>' cmake ../src
3. Check which assembler was chosen:
grep ASM-ATT_COMPILER:FILEPATH CMakeCache.txt
I propose to solve that by replacing '-' by '_' when searching for environment variable in CMakeDetermineASMCompiler.cmake. It is possible to preserve backward compatibility by searching for both old and new variable. However, because it was so difficult to set ASM-ATT env variable, it is probably not needed.
No tags attached.
Issue History
2016-02-13 18:11Paweł StankowskiNew Issue
2016-02-13 18:20Paweł StankowskiNote Added: 0040487
2016-02-13 18:21Paweł StankowskiNote Edited: 0040487bug_revision_view_page.php?bugnote_id=40487#r2025
2016-02-13 18:21Paweł StankowskiNote Edited: 0040487bug_revision_view_page.php?bugnote_id=40487#r2026
2016-02-13 18:22Paweł StankowskiNote Edited: 0040487bug_revision_view_page.php?bugnote_id=40487#r2027
2016-06-10 14:29Kitware RobotNote Added: 0042940
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0040487)
Paweł Stankowski   
2016-02-13 18:20   
(edited on: 2016-02-13 18:22)
BTW: Maybe some more/other environment variables should be supported.
make checks AS and ASFLAGS environment variables:
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html [^]
standard 'CC' and 'CFLAGS' env variables are already supported, why not add the assembler ones?

autoconf sets and automake use 'CCAS' and 'CCASFLAGS' environment variables:
https://www.gnu.org/software/automake/manual/html_node/Assembly-Support.html [^]

(0042940)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.