User account creation filtered due to spam.

Bug 22330 - Building a cross linux->win32 incorrectly sets HAVE_GAS_SHF_MERGE true
Summary: Building a cross linux->win32 incorrectly sets HAVE_GAS_SHF_MERGE true
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-06 21:08 UTC by Rutger Ovidius
Modified: 2008-01-26 11:56 UTC (History)
3 users (show)

See Also:
Host: i686-pc-mingw32
Target: i686-pc-mingw32
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
config.log (987 bytes, application/octet-stream)
2005-07-07 16:29 UTC, Rutger Ovidius
Details
config.zip (32.45 KB, application/octet-stream)
2005-07-07 17:14 UTC, Rutger Ovidius
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rutger Ovidius 2005-07-06 21:08:26 UTC
gcc/gcc/java/class.c

if (HAVE_GAS_SHF_MERGE) should be false for windows target.  However,
it's definition is done by configure for _host_, and it ends up as true
in auto-host.h if you cross compile
Comment 1 Andrew Pinski 2005-07-07 15:34:33 UTC
This does not make sense as gcc_GAS_CHECK_FEATURE is used for other target features all over 
configure.ac.  Could you attach the config.log for your cross build?
Comment 2 Rutger Ovidius 2005-07-07 16:29:07 UTC
Created attachment 9222 [details]
config.log

The config.log doesn't say much, unless you want a config.log from some other
directory.

I'm just reporting the analysis by Danny Smith. 

http://sourceforge.net/mailarchive/message.php?msg_id=12284892

Occurs with both my own cross build, and the cross build from
http://www.thisiscool.com/gcc_mingw.htm
Comment 3 Andrew Pinski 2005-07-07 16:56:03 UTC
I wanted the config.log from the gcc directory, sorry.
Comment 4 Rutger Ovidius 2005-07-07 17:14:13 UTC
Created attachment 9224 [details]
config.zip 

Ok. 

config.log.cross is the cross
config.log.wingcc is the mingw32

HAVE_GAS_SHF_MERGE is 0 in the cross, 1 in the mingw32 built by the cross.
Comment 5 Andrew Pinski 2005-07-07 17:15:52 UTC
So it is a candian cross and not really a cross which is causing this.
Comment 6 Andrew Pinski 2005-07-07 17:19:22 UTC
We are picking up the wrong as:
cross:
gcc_cv_as=/home/gcc/build/crossgcc/i686-pc-mingw32/bin/as
candian cross:
gcc_cv_as=/usr/bin/as

So that is the problem, could you figure out how to pick up the cross's as for candian cross.
Comment 7 Rutger Ovidius 2005-07-07 21:24:34 UTC
I don't know how to do that with the current configure.

Build != Host 
--build=i686-pc-linux-gnu --host=i686-pc-mingw32 --target=i686-pc-mingw32

From configure.ac:
# If build != host, and we aren't building gas in-tree, we identify a
# build->target assembler and hope that it will have the same features
# as the host->target assembler we'll be using.

(which is wrong in this case)

And configure.ac is using 'test -x' on environment variables $AS and 
$AS_FOR_TARGET, which always have their paths stripped, so I can't set it 
to "/home/gcc/build/crossgcc/bin/i686-pc-mingw32-as" or "i686-pc-mingw32-as" 
and pass the "test -x" test, even though that is the $AS that will ultimately 
be used to assemble. 

Manually changing the "elif test -x "$AS_FOR_TARGET"; then" line in 
gcc/configure to "-n" makes it use the env variable, and sets 
HAVE_GAS_SHF_MERGE 0, which is what I want, but I doubt this is the right way 
to do it.
Comment 8 Andrew Pinski 2005-08-17 03:29:38 UTC
(In reply to comment #7)
> I don't know how to do that with the current configure.
> 
> Build != Host 
> --build=i686-pc-linux-gnu --host=i686-pc-mingw32 --target=i686-pc-mingw32
> 
> From configure.ac:
> # If build != host, and we aren't building gas in-tree, we identify a
> # build->target assembler and hope that it will have the same features
> # as the host->target assembler we'll be using.
> 
> (which is wrong in this case)

Actually it better or there is something wrong as basicially you cannot really mix match the as versions 
of a Candian cross.
Comment 9 Mohan Embar 2005-11-04 06:41:25 UTC
I was able to "fix" this issue with an explicit --with-as=<full path to i686-pc-mingw32-as> and --with-ld=<full path to i686-pc-mingw32-ld>. The crossed native compiler passes the testcase that Rutger sent me.

Note that the correct term for the compiler we're referring to is "x-host-x, crossed native or crossed-built native" and not a Canadian cross. See http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gccint/Configure-Terms.html
Comment 10 Richard Biener 2008-01-26 11:56:30 UTC
Closed as fixed as of the last comment.