Closed Bug 1422254 Opened 2 years ago Closed 2 years ago

inlining failed in call to always_inline ‘memcpy’ error when compiling with GCC and ASan + FORTIFY_SOURCE enabled

Categories

(Firefox Build System :: General, defect)

52 Branch
Unspecified
Linux
defect
Not set

Tracking

(firefox59 affected)

RESOLVED DUPLICATE of bug 1418052
Tracking Status
firefox59 --- affected

People

(Reporter: gk, Unassigned)

References

Details

The fix for bug 1279096 breaks compilation with GCC and ASan + FORTIFY_SOURCE enabled:

In file included from /usr/include/features.h:406:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/limits.h:26,
                 from /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed/limits.h:168,
                 from /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed/limits.h:34,
                 from /home/thomas/Arbeit/Tor/tor-browser/obj-x86_64-pc-linux-gnu/js/src/ctypes/libffi/include/ffi.h:76,
                 from /home/thomas/Arbeit/Tor/tor-browser/js/src/ctypes/libffi/src/x86/ffi64.c:30:
/home/thomas/Arbeit/Tor/tor-browser/js/src/ctypes/libffi/src/x86/ffi64.c: In function ‘ffi_call’:
/usr/include/x86_64-linux-gnu/bits/string3.h:50:1: error: inlining failed in call to always_inline ‘memcpy’: function attribute mismatch
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 ^
/home/thomas/Arbeit/Tor/tor-browser/js/src/ctypes/libffi/src/x86/ffi64.c:485:4: note: called from here
    memcpy (argp, avalue[i], size);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This happens at least with GCC 5.x and GCC 6.x.
I posted this in the tor bug also (https://trac.torproject.org/projects/tor/ticket/21925) but I don't think you're supposed to build ASAN with FORTIFY.
See Also: → 1419607, 1377553
Closing this on the theory that you're not supposed to build with both ASan and FORTIFY_SOURCE. Reopen if you disagree.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
(In reply to Jason Orendorff [:jorendorff] from comment #2)
> Closing this on the theory that you're not supposed to build with both ASan
> and FORTIFY_SOURCE. Reopen if you disagree.

I don't disagree with excluding FORTIFY_SOURCE when building with ASan given the current state of affairs. But I think building with both should not result in a compilation failure as mentioned in this ticket. Thus, this ticket does not seem to be INVALID to me: if ASan + FORTIFY_SOURCE is an unsupported combination (which seems reasonable to me) then anyone trying that should either fail earlier in a cleaner way (e.g. during configure) or Firefox should just not use FORTIFY_SOURCE in that case. Maybe bug 1419607 could help with that (in which case this ticket would be a duplicate of that one).
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Good point. Moving this bug to the build system, on that theory -- seems like it could be a pretty simple patch.
Component: js-ctypes → Build Config
Fair point. This should get resolved in Bug 1418052 though, which is hopefully close to passing review.
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1418052
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.