public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: *FLAGS_FOR_BUILD vs cross-compiling
       [not found] <200710061910.23606.vapier@gentoo.org>
@ 2007-10-07  4:25 ` Daniel Jacobowitz
  2007-10-07  7:19   ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-10-07  4:25 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, gcc-patches

On Sat, Oct 06, 2007 at 07:10:23PM -0400, Mike Frysinger wrote:
> the toplevel configure.ac currently does:
> CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
> CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CFLAGS}}
> LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${CFLAGS}}
> 
> there's two things wrong here ... first, the default for CXXFLAGS/LDFLAGS 
> should be CXXFLAGS/LDFLAGS, not CFLAGS.  the other is that FOR_BUILD 
> variables should not default to the host flags if $host != $build.  the 
> program FOR_BUILD variables (like AR/RANLIB/etc...) already test this, but 
> the *FLAGS do not.  so if you try to build like:
> CFLAGS="-m4" ./configure --build=x86_64-... --host=sh4-... --target=sh4-...
> it'll fail if any build binaries need to be compiled (like the "chew" binary 
> in bfd/doc/).
> 
> the attached patch should rectify both of these issues.

These files are shared with gcc, so I've forwarded to gcc-patches
where more toplevel build reviewers tend to hang out.  It seems
reasonable to me.

> -mike
> 
> 2007-10-06  Mike Frysinger  <vapier@gentoo.org>
> 
> 	* configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD,
> 	LDFLAGS_FOR_BUILD): Default them to host flags only for $host = $build.
> 	Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS.  Set default
> 	LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS.
> 	* configure: Regenerate.



> 2007-10-06  Mike Frysinger  <vapier@gentoo.org>
> 
> 	* configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD,
> 	LDFLAGS_FOR_BUILD): Default them to host flags only for $host = $build.
> 	Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS.  Set default
> 	LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS.
> 	* configure: Regenerate.
> 
> --- configure.ac	1 Oct 2007 07:55:47 -0000	1.30
> +++ configure.ac	6 Oct 2007 23:06:00 -0000
> @@ -2387,9 +2387,11 @@ esac
>  
>  # Allow the user to override the flags for
>  # our build compiler if desired.
> -CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
> -CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CFLAGS}}
> -LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${CFLAGS}}
> +if test x"${build}" = x"${host}" ; then
> +  CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
> +  CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
> +  LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
> +fi
>  
>  # On Canadian crosses, we'll be searching the right directories for
>  # the previously-installed cross compiler, so don't bother to add


-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: *FLAGS_FOR_BUILD vs cross-compiling
  2007-10-07  4:25 ` *FLAGS_FOR_BUILD vs cross-compiling Daniel Jacobowitz
@ 2007-10-07  7:19   ` Paolo Bonzini
  2007-10-07 15:30     ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2007-10-07  7:19 UTC (permalink / raw)
  To: Mike Frysinger, binutils, gcc-patches


>> 2007-10-06  Mike Frysinger  <vapier@gentoo.org>
>>
>> 	* configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD,
>> 	LDFLAGS_FOR_BUILD): Default them to host flags only for $host = $build.
>> 	Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS.  Set default
>> 	LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS.

Yes, ok.  Thanks, and sorry.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: *FLAGS_FOR_BUILD vs cross-compiling
  2007-10-07  7:19   ` Paolo Bonzini
@ 2007-10-07 15:30     ` Mike Frysinger
  2007-10-08  9:31       ` Nick Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2007-10-07 15:30 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: binutils, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

On Sunday 07 October 2007, Paolo Bonzini wrote:
> >> 2007-10-06  Mike Frysinger  <vapier@gentoo.org>
> >>
> >> 	* configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD,
> >> 	LDFLAGS_FOR_BUILD): Default them to host flags only for $host = $build.
> >> 	Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS.  Set default
> >> 	LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS.
>
> Yes, ok.  Thanks, and sorry.

so how does the committing work here ?  i can commit in sourceware, but not 
gcc ...
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: *FLAGS_FOR_BUILD vs cross-compiling
  2007-10-07 15:30     ` Mike Frysinger
@ 2007-10-08  9:31       ` Nick Clifton
  2007-10-08 11:30         ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2007-10-08  9:31 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Paolo Bonzini, binutils, gcc-patches

Hi Mike,

>>>> 	* configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD,
>>>> 	LDFLAGS_FOR_BUILD): Default them to host flags only for $host = $build.
>>>> 	Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS.  Set default
>>>> 	LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS.
>> Yes, ok.  Thanks, and sorry.
> 
> so how does the committing work here ?  i can commit in sourceware, but not 
> gcc ...

I have checked your patch into both the gcc and sourceware repositories.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: *FLAGS_FOR_BUILD vs cross-compiling
  2007-10-08  9:31       ` Nick Clifton
@ 2007-10-08 11:30         ` Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2007-10-08 11:30 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Paolo Bonzini, binutils, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]

On Monday 08 October 2007, Nick Clifton wrote:
> >>>> 	* configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD,
> >>>> 	LDFLAGS_FOR_BUILD): Default them to host flags only for $host =
> >>>> $build. Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS.  Set
> >>>> default LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS.
> >>
> >> Yes, ok.  Thanks, and sorry.
> >
> > so how does the committing work here ?  i can commit in sourceware, but
> > not gcc ...
>
> I have checked your patch into both the gcc and sourceware repositories.

ah, that works ... thanks :)
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-08 11:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200710061910.23606.vapier@gentoo.org>
2007-10-07  4:25 ` *FLAGS_FOR_BUILD vs cross-compiling Daniel Jacobowitz
2007-10-07  7:19   ` Paolo Bonzini
2007-10-07 15:30     ` Mike Frysinger
2007-10-08  9:31       ` Nick Clifton
2007-10-08 11:30         ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).