All of lore.kernel.org
 help / color / mirror / Atom feed
* 4.98 fails to build with newer gcc
@ 2012-01-13 13:10 Bastien Nocera
  2012-01-13 16:26 ` Siarhei Siamashka
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2012-01-13 13:10 UTC (permalink / raw)
  To: linux-bluetooth

A few warnings:

sbc/sbc.c:766:34: warning: always_inline function might not be inlinable [-Wattributes]
sbc/sbc.c:558:34: warning: always_inline function might not be inlinable [-Wattributes]
sbc/sbc.c:163:31: warning: always_inline function might not be inlinable [-Wattributes]

and an error

sbc/sbc_primitives_mmx.c: In function 'sbc_calc_scalefactors_mmx':
sbc/sbc_primitives_mmx.c:294:4: warning: asm operand 2 probably doesn't match constraints [enabled by default]
sbc/sbc_primitives_mmx.c:294:4: error: impossible constraint in 'asm'

Full build log:
http://koji.fedoraproject.org/koji/getfile?taskID=3657376&name=build.log
Using gcc 4.7.0 as mentioned in root log:
http://koji.fedoraproject.org/koji/getfile?taskID=3657376&name=root.log

The same build works correctly with gcc 4.6.1 on Fedora 16.

Any ideas?


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

* Re: 4.98 fails to build with newer gcc
  2012-01-13 13:10 4.98 fails to build with newer gcc Bastien Nocera
@ 2012-01-13 16:26 ` Siarhei Siamashka
  2012-01-23 11:54   ` Johan Hedberg
  0 siblings, 1 reply; 5+ messages in thread
From: Siarhei Siamashka @ 2012-01-13 16:26 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

On Fri, Jan 13, 2012 at 3:10 PM, Bastien Nocera <hadess@hadess.net> wrote:
> A few warnings:
>
> sbc/sbc.c:766:34: warning: always_inline function might not be inlinable [-Wattributes]
> sbc/sbc.c:558:34: warning: always_inline function might not be inlinable [-Wattributes]
> sbc/sbc.c:163:31: warning: always_inline function might not be inlinable [-Wattributes]

Looks like the new version of gcc requires both "inline" and
"__attribute__((always_inline))" to be used in SBC_ALWAYS_INLINE
according to [1].

> and an error
>
> sbc/sbc_primitives_mmx.c: In function 'sbc_calc_scalefactors_mmx':
> sbc/sbc_primitives_mmx.c:294:4: warning: asm operand 2 probably doesn't match constraints [enabled by default]
> sbc/sbc_primitives_mmx.c:294:4: error: impossible constraint in 'asm'

Here gcc 4.7 thinks that
				"i" ((char *) &sb_sample_f[1][0][0] -
					(char *) &sb_sample_f[0][0][0]),
is an impossible constraint. According to [2], "i" means "An immediate
integer operand (one with constant value) is allowed. This includes
symbolic constants whose values will be known only at assembly time or
later".
Earlier versions of gcc could see that this expression is a compile
time constant, but gcc 4.7 can't. As a workaround, "i" can be changed
to "r" here. The downside is that this needs one more register for
inline assembly and the number of available registers is really
limited for 32-bit x86 systems. As a test, it is possible to try "gcc
-O2 -mmmx -c -m32 -fno-omit-frame-pointer -fPIC sbc_primitives_mmx.c".
Both "-fno-omit-frame-pointer" and "-fPIC" options reduce the number
of available registers.

> Full build log:
> http://koji.fedoraproject.org/koji/getfile?taskID=3657376&name=build.log
> Using gcc 4.7.0 as mentioned in root log:
> http://koji.fedoraproject.org/koji/getfile?taskID=3657376&name=root.log
>
> The same build works correctly with gcc 4.6.1 on Fedora 16.
>
> Any ideas?
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

1. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49139#c1
2. http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc/Simple-Constraints.html#Simple-Constraints

-- 
Best regards,
Siarhei Siamashka

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

* Re: 4.98 fails to build with newer gcc
  2012-01-13 16:26 ` Siarhei Siamashka
@ 2012-01-23 11:54   ` Johan Hedberg
  2012-01-23 12:05     ` Bastien Nocera
  2012-02-24 12:16     ` Siarhei Siamashka
  0 siblings, 2 replies; 5+ messages in thread
From: Johan Hedberg @ 2012-01-23 11:54 UTC (permalink / raw)
  To: Siarhei Siamashka; +Cc: Bastien Nocera, linux-bluetooth

Hi,

On Fri, Jan 13, 2012, Siarhei Siamashka wrote:
> On Fri, Jan 13, 2012 at 3:10 PM, Bastien Nocera <hadess@hadess.net> wrote:
> > A few warnings:
> >
> > sbc/sbc.c:766:34: warning: always_inline function might not be inlinable [-Wattributes]
> > sbc/sbc.c:558:34: warning: always_inline function might not be inlinable [-Wattributes]
> > sbc/sbc.c:163:31: warning: always_inline function might not be inlinable [-Wattributes]
> 
> Looks like the new version of gcc requires both "inline" and
> "__attribute__((always_inline))" to be used in SBC_ALWAYS_INLINE
> according to [1].
> 
> > and an error
> >
> > sbc/sbc_primitives_mmx.c: In function 'sbc_calc_scalefactors_mmx':
> > sbc/sbc_primitives_mmx.c:294:4: warning: asm operand 2 probably doesn't match constraints [enabled by default]
> > sbc/sbc_primitives_mmx.c:294:4: error: impossible constraint in 'asm'
> 
> Here gcc 4.7 thinks that
> 				"i" ((char *) &sb_sample_f[1][0][0] -
> 					(char *) &sb_sample_f[0][0][0]),
> is an impossible constraint. According to [2], "i" means "An immediate
> integer operand (one with constant value) is allowed. This includes
> symbolic constants whose values will be known only at assembly time or
> later".
> Earlier versions of gcc could see that this expression is a compile
> time constant, but gcc 4.7 can't. As a workaround, "i" can be changed
> to "r" here. The downside is that this needs one more register for
> inline assembly and the number of available registers is really
> limited for 32-bit x86 systems. As a test, it is possible to try "gcc
> -O2 -mmmx -c -m32 -fno-omit-frame-pointer -fPIC sbc_primitives_mmx.c".
> Both "-fno-omit-frame-pointer" and "-fPIC" options reduce the number
> of available registers.

So is someone going to send a patch for this? I think we should try to
have it fixed before doing the next BlueZ release.

Johan

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

* Re: 4.98 fails to build with newer gcc
  2012-01-23 11:54   ` Johan Hedberg
@ 2012-01-23 12:05     ` Bastien Nocera
  2012-02-24 12:16     ` Siarhei Siamashka
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2012-01-23 12:05 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: Siarhei Siamashka, linux-bluetooth

On Mon, 2012-01-23 at 13:54 +0200, Johan Hedberg wrote:
> Hi,
> 
> On Fri, Jan 13, 2012, Siarhei Siamashka wrote:
> > On Fri, Jan 13, 2012 at 3:10 PM, Bastien Nocera <hadess@hadess.net> wrote:
> > > A few warnings:
> > >
> > > sbc/sbc.c:766:34: warning: always_inline function might not be inlinable [-Wattributes]
> > > sbc/sbc.c:558:34: warning: always_inline function might not be inlinable [-Wattributes]
> > > sbc/sbc.c:163:31: warning: always_inline function might not be inlinable [-Wattributes]
> > 
> > Looks like the new version of gcc requires both "inline" and
> > "__attribute__((always_inline))" to be used in SBC_ALWAYS_INLINE
> > according to [1].
> > 
> > > and an error
> > >
> > > sbc/sbc_primitives_mmx.c: In function 'sbc_calc_scalefactors_mmx':
> > > sbc/sbc_primitives_mmx.c:294:4: warning: asm operand 2 probably doesn't match constraints [enabled by default]
> > > sbc/sbc_primitives_mmx.c:294:4: error: impossible constraint in 'asm'
> > 
> > Here gcc 4.7 thinks that
> > 				"i" ((char *) &sb_sample_f[1][0][0] -
> > 					(char *) &sb_sample_f[0][0][0]),
> > is an impossible constraint. According to [2], "i" means "An immediate
> > integer operand (one with constant value) is allowed. This includes
> > symbolic constants whose values will be known only at assembly time or
> > later".
> > Earlier versions of gcc could see that this expression is a compile
> > time constant, but gcc 4.7 can't. As a workaround, "i" can be changed
> > to "r" here. The downside is that this needs one more register for
> > inline assembly and the number of available registers is really
> > limited for 32-bit x86 systems. As a test, it is possible to try "gcc
> > -O2 -mmmx -c -m32 -fno-omit-frame-pointer -fPIC sbc_primitives_mmx.c".
> > Both "-fno-omit-frame-pointer" and "-fPIC" options reduce the number
> > of available registers.
> 
> So is someone going to send a patch for this? I think we should try to
> have it fixed before doing the next BlueZ release.

I won't be. I'm expecting upstream to come up with one :)


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

* Re: 4.98 fails to build with newer gcc
  2012-01-23 11:54   ` Johan Hedberg
  2012-01-23 12:05     ` Bastien Nocera
@ 2012-02-24 12:16     ` Siarhei Siamashka
  1 sibling, 0 replies; 5+ messages in thread
From: Siarhei Siamashka @ 2012-02-24 12:16 UTC (permalink / raw)
  To: Siarhei Siamashka, Bastien Nocera, linux-bluetooth

On Mon, Jan 23, 2012 at 1:54 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi,
>
> On Fri, Jan 13, 2012, Siarhei Siamashka wrote:
>> On Fri, Jan 13, 2012 at 3:10 PM, Bastien Nocera <hadess@hadess.net> wrote:
>> > A few warnings:
>> >
>> > sbc/sbc.c:766:34: warning: always_inline function might not be inlinable [-Wattributes]
>> > sbc/sbc.c:558:34: warning: always_inline function might not be inlinable [-Wattributes]
>> > sbc/sbc.c:163:31: warning: always_inline function might not be inlinable [-Wattributes]
>>
>> Looks like the new version of gcc requires both "inline" and
>> "__attribute__((always_inline))" to be used in SBC_ALWAYS_INLINE
>> according to [1].
>>
>> > and an error
>> >
>> > sbc/sbc_primitives_mmx.c: In function 'sbc_calc_scalefactors_mmx':
>> > sbc/sbc_primitives_mmx.c:294:4: warning: asm operand 2 probably doesn't match constraints [enabled by default]
>> > sbc/sbc_primitives_mmx.c:294:4: error: impossible constraint in 'asm'
>>
>> Here gcc 4.7 thinks that
>>                               "i" ((char *) &sb_sample_f[1][0][0] -
>>                                       (char *) &sb_sample_f[0][0][0]),
>> is an impossible constraint. According to [2], "i" means "An immediate
>> integer operand (one with constant value) is allowed. This includes
>> symbolic constants whose values will be known only at assembly time or
>> later".
>> Earlier versions of gcc could see that this expression is a compile
>> time constant, but gcc 4.7 can't. As a workaround, "i" can be changed
>> to "r" here. The downside is that this needs one more register for
>> inline assembly and the number of available registers is really
>> limited for 32-bit x86 systems. As a test, it is possible to try "gcc
>> -O2 -mmmx -c -m32 -fno-omit-frame-pointer -fPIC sbc_primitives_mmx.c".
>> Both "-fno-omit-frame-pointer" and "-fPIC" options reduce the number
>> of available registers.
>
> So is someone going to send a patch for this? I think we should try to
> have it fixed before doing the next BlueZ release.

Sorry for the slow follow up.

I reported the build error problem to gcc bugzilla (where it actually
belongs), and now this should be fixed in gcc 4.7:
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52355

A simple patch for the inlining warning fix is sent as a separate e-mail.

-- 
Best regards,
Siarhei Siamashka

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

end of thread, other threads:[~2012-02-24 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-13 13:10 4.98 fails to build with newer gcc Bastien Nocera
2012-01-13 16:26 ` Siarhei Siamashka
2012-01-23 11:54   ` Johan Hedberg
2012-01-23 12:05     ` Bastien Nocera
2012-02-24 12:16     ` Siarhei Siamashka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.