Bug 1320345 - lttng-tools FTBFS on aarch64 epel7
Summary: lttng-tools FTBFS on aarch64 epel7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: lttng-tools
Version: epel7
Hardware: aarch64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Ken Dreyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1319882
Blocks: epel7aarch64
TreeView+ depends on / blocked
 
Reported: 2016-03-22 23:09 UTC by D. Marlin
Modified: 2017-01-27 02:18 UTC (History)
5 users (show)

Fixed In Version: lttng-tools-2.4.1-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-25 19:35:15 UTC
Type: Bug


Attachments (Terms of Use)
preprocessed gen-ust-events.i file (156.07 KB, text/plain)
2016-05-27 14:45 UTC, D. Marlin
no flags Details

Description D. Marlin 2016-03-22 23:09:54 UTC
Description of problem:

lttng-tools fails to build from source for Fedora EPEL7 on RHELSA-7.2.


Version-Release number of selected component (if applicable):

lttng-tools-2.4.1-1.el7


How reproducible:

consistently


Steps to Reproduce:
1.  On a RHELSA-7.2 host:
    mock -r epel-7-aarch64 lttng-tools-2.4.1-1.el7.src.rpm
2.
3.

Actual results:

Fails to build with the following error:

gcc -DHAVE_CONFIG_H -I../../../.. -I../../../.. -I../../../../src -I../../../../include -include config.h    -I../../../../include -I../../../../src -I../../../../tests -I. -O2 -g -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1  -g -fno-strict-aliasing -c tp.c
In file included from /usr/include/lttng/tracepoint.h:38:0,
                 from tp.h:20,
                 from gen-ust-events.c:29:
gen-ust-events.c: In function 'main':
gen-ust-events.c:54:3: error: 'asm' operand requires impossible reload
   tracepoint(tp, tptest, i, netint, values, text, strlen(text), escape, dbl, flt);
   ^

Expected results:

builds without errors.


Additional info:

This SRPM does build successfully on Fedora 21 for AArch64.

  mock -r fedora-21-aarch64 lttng-tools-2.4.1-1.el7.src.rpm
        :

  Wrote: /builddir/build/RPMS/lttng-tools-2.4.1-1.fc21.aarch64.rpm
  Wrote: /builddir/build/RPMS/lttng-tools-devel-2.4.1-1.fc21.aarch64.rpm
  Wrote: /builddir/build/RPMS/lttng-tools-debuginfo-2.4.1-1.fc21.aarch64.rpm

Comment 1 Nick Clifton 2016-05-18 10:09:50 UTC
Hi David,

  Please could you upload a preprocessed version of the gen-ust-events.c file for me to look at ?  (The tracepoint macro appears to lead into a twisty maze 
of include files which I am finding hard to follow).

Cheers
  Nick

Comment 2 Nick Clifton 2016-05-26 15:14:40 UTC
Just to note - this is a gcc problem, not a binutils problem.

The gen-ust-events.c file includes an extremely long and complex inline assembler
statement, and the poor (gcc v4.8.5) compiler is unable to handle it.  A fix would be to use a newer compiler.  A workaround might be to break out the inline
assembler into its own assembler source file.

Cheers
  Nick

Comment 3 D. Marlin 2016-05-27 14:45:22 UTC
Created attachment 1162507 [details]
preprocessed gen-ust-events.i file

This is the preprocessed (intermediate) file for gen-ust-events.c

Comment 4 Yaakov Selkowitz 2016-05-30 17:02:06 UTC
(In reply to Nick Clifton from comment #2)
> Just to note - this is a gcc problem, not a binutils problem.
> 
> The gen-ust-events.c file includes an extremely long and complex inline
> assembler
> statement, and the poor (gcc v4.8.5) compiler is unable to handle it.

Yet it builds on x86_64 and ppc64.

> A fix would be to use a newer compiler.

As an EPEL package, only the RHEL compiler can be used.

> A workaround might be to break out the inline assembler into its own assembler
> source file.

I don't think that's feasible, given that it is expanded from the lttng headers.

Comment 5 D. Marlin 2016-06-01 17:16:02 UTC
Andrew Haley suggested making the following change:

  +#pragma GCC optimize ("O1")
  +
   #define TRACEPOINT_DEFINE
   #include "tp.h"
   
   int
   main (int argc, char **argv)
   {

to tests/regression/tools/filtering/gen-ust-events.c

When I did this, I was able to build it in a mock environment without errors.

Please make this change so we can build for EPEL7 on AArch64.

Comment 6 Frank Ch. Eigler 2016-06-02 14:22:37 UTC
Future versions of the systemtap sys/sdt.h file will include this explanatory blurb, which should help diagnose the problem:

/*
  This file defines a family of macros

       STAP_PROBEn(op1, ..., opn)

  that emit a nop into the instruction stream, and some data into an auxiliary
  note section.  The data in the note section describes the operands, in terms
  of size and location.  Each location is encoded as assembler operand string.
  Consumer tools such as gdb or systemtap insert breakpoints on top of
  the nop, and decode the location operand-strings, like an assembler,
  to find the values being passed.

  The operand strings are selected by the compiler for each operand.
  They are constrained by gcc inline-assembler codes.  The default is:

  #define STAP_SDT_ARG_CONSTRAINT nor

  This is a good default if the operands tend to be integral and
  moderate in number (smaller than number of registers).  In other
  cases, the compiler may report "'asm' requires impossible reload" or
  similar.  In this case, consider simplifying the macro call (fewer
  and simpler operands), reduce optimization, or override the default
  constraints string via:

  #define STAP_SDT_ARG_CONSTRAINT g
  #include <sys/sdt.h>

  See also:
  https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
  https://gcc.gnu.org/onlinedocs/gcc/Constraints.html
 */

Comment 7 D. Marlin 2016-11-21 19:47:49 UTC
Now that lttng-ust is building on AArch64 (rhbz#1319882), would it be possible to make the change mentioned in Comment 5 so lttng-tools will build as well.  I did a scratch build with a patch to make that change, and it completed successfully:

  http://koji.fedoraproject.org/koji/taskinfo?taskID=16555739

Comment 8 Ken Dreyer 2016-11-22 20:05:26 UTC
Thanks D. Marlin!

Please feel free to push and build for EPEL 7.

Comment 9 D. Marlin 2016-11-23 17:22:20 UTC
I was just checking the later 2.4.1 Fedora builds, and found a similar issue had already been addressed for s390(x) using the following spec file change:

  %ifarch s390 s390x
  # workaround rhbz#837572 (ICE in gcc)
  %global optflags %(echo %{optflags} | sed 's/-O2/-O1/')
  %endif

Rather than add an aarch64 specific patch, I tried applying that change for AArch64 as well, and it successfully builds:

  http://koji.fedoraproject.org/koji/taskinfo?taskID=16583151

If it's OK with you, I'll just push this change instead of the previously proposed patch, since it also works for AArch64 and has already been reviewed and approved for s390(x).

Comment 10 Fedora Update System 2016-12-05 16:31:16 UTC
lttng-tools-2.4.1-5.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-fafacdd7b8

Comment 11 Fedora Update System 2016-12-06 04:21:19 UTC
lttng-tools-2.4.1-5.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-fafacdd7b8

Comment 12 D. Marlin 2017-01-25 19:35:15 UTC
lttng-tools-2.4.1-5.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2017-01-27 02:18:05 UTC
lttng-tools-2.4.1-5.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.