xinguai / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

libgtest.0.dylib builds x86_64 only on Mac OSX 10.6 #215

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. ./configure on OSX 10.6 (gcc version i686-apple-darwin10-gcc-4.2.1 (GCC) 
4.2.1 (Apple Inc. 
build 5646))
2. sudo make install
3. build test executable with '-m32'

What is the expected output? What do you see instead?

Should link appropriately. Instead we see 'ld: warning: in 
/usr/local/lib/libgtest.dylib, file is not 
of required architecture'

What version of the product are you using? On what operating system?

svn 336

Mac OS X 10.6.1

Please provide any additional information below, such as a code snippet.

gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646~6/src/configure --disable-checking 
--enable-
werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ 
--
program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib 
--build=i686-
apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 
--program-prefix=i686-apple-
darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646)

ld -v
@(#)PROGRAM:ld  PROJECT:ld64-95.2.12

Workaround is to configure gtest with -m32 flag which builds i386 library. I 
used:

CC='gcc -m32' CXX='g++ -m32' ./configure

Original issue reported on code.google.com by ldalessa...@gmail.com on 4 Nov 2009 at 2:42

GoogleCodeExporter commented 9 years ago
Creating mixed architecture libraries via "make" is difficult. It involves 
building the application multiple times in 
separate directories, then calling the "lipo" command to put things together. 
We provide an Xcode project 
(accessible via the command-line with "xcodebuild"), to make 4-way universal 
binaries. The README has a good 
explanation about how to use the xcode project via the terminal.

See here: http://code.google.com/p/googletest/source/browse/trunk/README

Original comment by preston....@gmail.com on 10 Nov 2009 at 12:04

GoogleCodeExporter commented 9 years ago
Ahh, rtm. I somehow didn't get that far through the README, having skimmed 
through to the "without Xcode" 
section and stopping there. I also skimmed the FAQ and Using XCode wiki pages.

I'll build it the xcode way in the future.

Original comment by ldalessa...@gmail.com on 10 Nov 2009 at 1:05

GoogleCodeExporter commented 9 years ago
Closing the issue per submitter's comments

Original comment by vladlosev on 10 Nov 2009 at 3:32