Patchwork [2/2] libatomics-ops: force omit frame pointer for x86 builds

login
register
mail settings
Submitter Jesse Zhang
Date July 17, 2013, 8:40 a.m.
Message ID <c95d46b97c8167bddcffb4495438227b668e87cb.1374050133.git.sen.zhang@windriver.com>
Download mbox | patch
Permalink /patch/53831/
State New
Headers show

Comments

Jesse Zhang - July 17, 2013, 8:40 a.m.
Fix failures when building with -fno-omit-frame-pointer (and without
optimization, i.e. -O0):

    In file included from atomic_ops.h:212:0,
                     from atomic_ops_stack.h:32,
                     from atomic_ops_stack.c:23:
    atomic_ops/sysdeps/gcc/x86.h: In function 'AO_compare_double_and_swap_double_full':
    atomic_ops/sysdeps/gcc/x86.h:148:3: error: 'asm' operand has impossible constraints
       __asm__ __volatile__("xchg %%ebx,%6;" /* swap GOT ptr and new_val1 */
       ^

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
---
 meta/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bb | 4 ++++
 1 file changed, 4 insertions(+)
Phil Blundell - July 17, 2013, 10:45 a.m.
On Wed, 2013-07-17 at 16:40 +0800, Jesse Zhang wrote:
> Fix failures when building with -fno-omit-frame-pointer (and without
> optimization, i.e. -O0):
> 
>     In file included from atomic_ops.h:212:0,
>                      from atomic_ops_stack.h:32,
>                      from atomic_ops_stack.c:23:
>     atomic_ops/sysdeps/gcc/x86.h: In function 'AO_compare_double_and_swap_double_full':
>     atomic_ops/sysdeps/gcc/x86.h:148:3: error: 'asm' operand has impossible constraints
>        __asm__ __volatile__("xchg %%ebx,%6;" /* swap GOT ptr and new_val1 */

This seems like it must be a bug in either GCC or the libatomic-ops
source code, and whichever one has the bug ought to be fixed.  Forcing
-fomit-frame-pointer might be ok as a temporary measure but it doesn't
seem like a very good long-term solution.

p.
Paul Barker - July 17, 2013, 11:08 a.m.
On 17 July 2013 11:45, Phil Blundell <pb@pbcl.net> wrote:
> On Wed, 2013-07-17 at 16:40 +0800, Jesse Zhang wrote:
>> Fix failures when building with -fno-omit-frame-pointer (and without
>> optimization, i.e. -O0):
>>
>>     In file included from atomic_ops.h:212:0,
>>                      from atomic_ops_stack.h:32,
>>                      from atomic_ops_stack.c:23:
>>     atomic_ops/sysdeps/gcc/x86.h: In function 'AO_compare_double_and_swap_double_full':
>>     atomic_ops/sysdeps/gcc/x86.h:148:3: error: 'asm' operand has impossible constraints
>>        __asm__ __volatile__("xchg %%ebx,%6;" /* swap GOT ptr and new_val1 */
>
> This seems like it must be a bug in either GCC or the libatomic-ops
> source code, and whichever one has the bug ought to be fixed.  Forcing
> -fomit-frame-pointer might be ok as a temporary measure but it doesn't
> seem like a very good long-term solution.
>

If this is on x86, standard Linux desktop/server distros may have ran
into the same problem. Maybe worth having a look if/how they handle
this.

--
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk
Henning Heinold - July 17, 2013, 2:53 p.m.
On Wed, Jul 17, 2013 at 12:08:51PM +0100, Paul Barker wrote:
> On 17 July 2013 11:45, Phil Blundell <pb@pbcl.net> wrote:
> > On Wed, 2013-07-17 at 16:40 +0800, Jesse Zhang wrote:
> >> Fix failures when building with -fno-omit-frame-pointer (and without
> >> optimization, i.e. -O0):
> >>
> >>     In file included from atomic_ops.h:212:0,
> >>                      from atomic_ops_stack.h:32,
> >>                      from atomic_ops_stack.c:23:
> >>     atomic_ops/sysdeps/gcc/x86.h: In function 'AO_compare_double_and_swap_double_full':
> >>     atomic_ops/sysdeps/gcc/x86.h:148:3: error: 'asm' operand has impossible constraints
> >>        __asm__ __volatile__("xchg %%ebx,%6;" /* swap GOT ptr and new_val1 */
> >
> > This seems like it must be a bug in either GCC or the libatomic-ops
> > source code, and whichever one has the bug ought to be fixed.  Forcing
> > -fomit-frame-pointer might be ok as a temporary measure but it doesn't
> > seem like a very good long-term solution.
> >
> 
> If this is on x86, standard Linux desktop/server distros may have ran
> into the same problem. Maybe worth having a look if/how they handle
> this.

This makes we wonder which software on x86 relies on libatomic-ops anymore?
gcc buildins should be good enough now.

Bye Henning
Jesse Zhang - July 18, 2013, 8:46 a.m.
On 07/17/2013 10:53 PM, Henning Heinold wrote:
> This makes we wonder which software on x86 relies on libatomic-ops anymore?
> gcc buildins should be good enough now.

pulseaudio depends on libatomics-ops though I don't know about the
reasons. The libatomics-ops recipe is actually inside the pulseaudio
dir.

jesse
Henning Heinold - July 18, 2013, 1:16 p.m.
On Thu, Jul 18, 2013 at 04:46:13PM +0800, Jesse Zhang wrote:
> On 07/17/2013 10:53 PM, Henning Heinold wrote:
> > This makes we wonder which software on x86 relies on libatomic-ops anymore?
> > gcc buildins should be good enough now.
> 
> pulseaudio depends on libatomics-ops though I don't know about the
> reasons. The libatomics-ops recipe is actually inside the pulseaudio
> dir.
> 
> jesse

Hm yes, I still feared it.

pulesaudio needed libatomic-ops only for mips architecture. I looked that up a
long time ago. Now with 2.0 release of pulseaudio and newer releases of gcc I believe
libatomic-ops is not needed anymore for pulseaudio.

Bye Henning

Patch

diff --git a/meta/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bb b/meta/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bb
index f31f983..98e4e0d 100644
--- a/meta/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bb
+++ b/meta/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bb
@@ -20,6 +20,10 @@  ALLOW_EMPTY_${PN} = "1"
 
 ARM_INSTRUCTION_SET = "arm"
 
+# the assembly in src/atomic_ops/sysdeps/gcc/x86.h:AO_compare_double_and_swap_double_full
+# doesn't work with -fno-omit-frame-pointer on x86
+TARGET_CFLAGS_x86 := "${TARGET_CFLAGS} -fomit-frame-pointer"
+
 inherit autotools pkgconfig
 
 do_install_append() {