View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010545CMakeCMakepublic2010-04-12 21:402010-10-06 14:12
ReporterDaniel Richard G. 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.3Fixed in VersionCMake 2.8.3 
Summary0010545: Bootstrap script presumes that ${CC} can be invoked without ${CFLAGS}
DescriptionBuilding CMake 2.8.1 on 64-bit AIX, I get this error:

---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE.
---------------------------------------------
Log of errors: /tmp/cmake--2.8.1.build/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

I disabled the bit that deletes the temporary directory in which make-testing takes place, invoked the test myself, and saw this:

user@host:/tmp/cmake--2.8.1.build/Bootstrap.cmk/cmake_bootstrap_1048776_test_dir> make
"gcc" -o test test.c
Assembler:
/tmp//ccQCk1QK.s: line 9: 1252-191 Only .llong should be used for relocatable expressions.
/tmp//ccQCk1QK.s: line 57: 1252-191 Only .llong should be used for relocatable expressions.
make: *** [test] Error 1

The makefile looks like this:

----begin makefile----
test: test.c
        "tg-gcc" -o test test.c
----end makefile----

I manually edited it to this:

----begin modified makefile----
test: test.c
        "tg-gcc" $(CFLAGS) -o test test.c
----end modified makefile----

and got the following result:

user@host:/tmp/cmake--2.8.1.build/Bootstrap.cmk/cmake_bootstrap_1048776_test_dir> make
"gcc" -pedantic -pipe -fno-common -W -Wall -Wcast-align -Wformat=2 -Wpointer-arith -Wundef -Waggregate-return -Wcast-qual -Wmissing-declarations -Wnested-externs -Wstrict-prototypes -maix64 -mminimal-toc -O3 -o test test.c
test.c:3: warning: function declaration isn't a prototype

This is on a 64-bit AIX system that does not have the libraries needed to link 32-bit programs. GCC on this platform produces 32-bit binaries by default, unless you specify -maix64. Meaning, GCC without -maix64 doesn't work.
TagsNo tags attached.
Attached Filespatch file icon cmake-10545-fix.patch [^] (408 bytes) 2010-04-22 14:12 [Show Content]

 Relationships

  Notes
(0020359)
Daniel Richard G. (reporter)
2010-04-22 14:13

The attached patch, against 2.8.1, fixes this bug. (You may want to consider adding $(LDFLAGS) in there as well; some setups may require that.)
(0022179)
Daniel Richard G. (reporter)
2010-09-10 10:32

I correct myself: This system actually can produce 32-bit libraries, but if you're not using -maix64, you have to set the OBJECT_MODE environment variable (or pass a special option in) or else the assembler complains:

> gcc -o foo foo.c
Assembler:
/tmp//ccbJJA40.s: line 1: 1252-192 Assembly mode is not specified.
        Set the OBJECT_MODE environment variable to 32 or 64 or
        use the -a32 or -a64 option.

> gcc -maix32 -o foo foo.c
Assembler:
/tmp//ccPOcuvf.s: line 1: 1252-192 Assembly mode is not specified.
        Set the OBJECT_MODE environment variable to 32 or 64 or
        use the -a32 or -a64 option.

> gcc -maix64 -o foo foo.c

>

$(CFLAGS) still needs to be passed to the compiler, of course.
(0022180)
Brad King (manager)
2010-09-10 11:39

The bootstrap script copies CFLAGS into "cmake_c_flags" (and similarly for LDFLAGS). Most of the compiler invocations use them. Try this patch:

diff --git a/bootstrap b/bootstrap
index 01d9e15..0da868d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -839,7 +839,7 @@ mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
 cd "${cmake_bootstrap_dir}/${TMPFILE}"
 echo '
 test: test.c
- "'"${cmake_c_compiler}"'" -o test test.c
+ "'"${cmake_c_compiler}"'" '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
 '>"Makefile"
 echo '
 #include <stdio.h>
(0022181)
Daniel Richard G. (reporter)
2010-09-10 13:26

Yep! The bootstrap process goes through with that change.
(0022182)
Brad King (manager)
2010-09-10 13:30

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7aa38ff [^]

 Issue History
Date Modified Username Field Change
2010-04-12 21:40 Daniel Richard G. New Issue
2010-04-22 14:12 Daniel Richard G. File Added: cmake-10545-fix.patch
2010-04-22 14:13 Daniel Richard G. Note Added: 0020359
2010-09-10 10:32 Daniel Richard G. Note Added: 0022179
2010-09-10 10:57 Bill Hoffman Status new => assigned
2010-09-10 10:57 Bill Hoffman Assigned To => Brad King
2010-09-10 11:39 Brad King Note Added: 0022180
2010-09-10 13:26 Daniel Richard G. Note Added: 0022181
2010-09-10 13:30 Brad King Note Added: 0022182
2010-09-10 13:30 Brad King Status assigned => closed
2010-09-10 13:30 Brad King Resolution open => fixed
2010-10-06 14:12 David Cole Fixed in Version => CMake 2.8.3
2010-10-06 14:12 David Cole Target Version => CMake 2.8.3


Copyright © 2000 - 2018 MantisBT Team