Bug 100017 - README: 32-on-64 bit build instructions doesn't work
Summary: README: 32-on-64 bit build instructions doesn't work
Status: RESOLVED FIXED
Alias: None
Product: piglit
Classification: Unclassified
Component: infrastructure (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Hi-Angel
QA Contact: Piglit Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-01 09:21 UTC by Hi-Angel
Modified: 2017-03-09 04:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Hi-Angel 2017-03-01 09:21:48 UTC
README says:

> if cross-compiling a 32-bit build on a 64-bit host, then you must
invoke cmake with option "-DCMAKE_SYSTEM_PROCESSOR=i386".

But,

	$ make clean
	$ cmake -DCMAKE_SYSTEM_PROCESSOR=i386 .             
	-- Configuring done
	-- Generating done
	-- Build files have been written to: /home/constantine/Projects/piglit
	$ make
	[  0%] Generating tests/util/piglit-dispatch-gen.c, tests/util/piglit-dispatch-gen.h, tests/util/piglit-util-gl-enum-gen.c
	[  0%] Built target piglit_dispatch_gen
	[  0%] Building C object target_api/no_api/tests/util/CMakeFiles/piglitutil.dir/piglit-log.c.o
	[  0%] Building C object target_api/no_api/tests/util/CMakeFiles/piglitutil.dir/piglit-util.c.o
	[  0%] Building C object target_api/no_api/tests/util/CMakeFiles/piglitutil.dir/piglit-util-egl.c.o
	^C
	[interrupt output skipped]
	$ file target_api/no_api/tests/util/CMakeFiles/piglitutil.dir/piglit-log.c.o
	target_api/no_api/tests/util/CMakeFiles/piglitutil.dir/piglit-log.c.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

cmake version: 3.7.2
make version: GNU Make 4.2.1
Comment 1 Mark Janes 2017-03-01 16:38:28 UTC
I build 32bit piglit by adding -m32 CFLAGS and CXXFLAGS environment variables during cmake invocation.

If that works for you, please send a patch for the README to the mailing list.
Comment 2 Hi-Angel 2017-03-01 17:20:51 UTC
I tried cleaning, then calling

	CFLAGS=-m32 CXXFLAGS=-m32 cmake -DCMAKE_SYSTEM_PROCESSOR=i386 .

but `make` still builds x86-64 objects for me. Oh well. I just thought someone have a solution offhand. I'll look at it later, probably on holydays.
Comment 3 Hi-Angel 2017-03-02 18:31:17 UTC
I sent a patch https://lists.freedesktop.org/archives/piglit/2017-March/021855.html

But what's interesting: it worked on the other PC, but now, at home, I built piglit, ran it, and it started skipping tests. Great. Turns out, it again built 64 bit instead of 32 bit, even with the known to work option. Unbelievable, they're even the same systems.
Comment 4 Hi-Angel 2017-03-02 20:49:18 UTC
Turns out, cmake somehow retains flags of the old run(s), that's why the inconsistent results. The correct way to build 32-on-64 (I tested it by removing the source, and git-cloning it again):

	cmake -DCMAKE_SYSTEM_PROCESSOR=x86 -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 .
	make

I'll write later the superseeding patch to README.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.