Bug 138840 - Incorrect detection of toolchain support for Cortex-A53 erratum 835769 workaround
Summary: Incorrect detection of toolchain support for Cortex-A53 erratum 835769 workar...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-18 11:39 PST by Akos Kiss
Modified: 2015-04-29 04:21 PDT (History)
3 users (show)

See Also:


Attachments
Proposed patch. (1.61 KB, patch)
2014-11-18 11:46 PST, Akos Kiss
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Akos Kiss 2014-11-18 11:39:03 PST
If the compiler already implements the workaround for the erratum but the linker still does not, the build fails with 
/usr/bin/ld: unrecognized option '--fix-cortex-a53-835769'

The current code in OptionsCommon.cmake only checks for the compilation to work but does not try to link.
Comment 1 Akos Kiss 2014-11-18 11:46:31 PST
Created attachment 241797 [details]
Proposed patch.
Comment 2 Csaba Osztrogonác 2014-11-19 00:26:52 PST
Comment on attachment 241797 [details]
Proposed patch.

r=me
Comment 3 WebKit Commit Bot 2014-11-19 01:06:28 PST
Comment on attachment 241797 [details]
Proposed patch.

Clearing flags on attachment: 241797

Committed r176314: <http://trac.webkit.org/changeset/176314>
Comment 4 WebKit Commit Bot 2014-11-19 01:06:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Alberto Garcia 2015-04-29 00:51:45 PDT
This fails in Debian, likely because of the -fuse-ld=gold flag:

/usr/bin/c++   -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wall -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0 -DNDEBUG  -std=c++11 -mfix-cortex-a53-835769  -fno-exceptions -fno-strict-aliasing -fno-rtti   -Wl,-z,relro -Wl,--as-needed -fuse-ld=gold -Wl,--disable-new-dtags CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o  -o ../../bin/LLIntOffsetsExtractor -rdynamic ../../lib/libWTFGTK.a -ldl ../../lib/libbmalloc.a -licui18n -licuuc -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lpthread -lz
/usr/bin/ld.gold: --fix-cortex-a53-835769: unknown option
/usr/bin/ld.gold: use the --help option for usage information
collect2: error: ld returned 1 exit status

Full log here:

https://buildd.debian.org/status/fetch.php?pkg=webkit2gtk&arch=arm64&ver=2.8.1%2Bdfsg1-1&stamp=1430218110
Comment 6 Csaba Osztrogonác 2015-04-29 01:33:35 PDT
Thanks for the report, I'll check and try to fix it soon.
Comment 7 Alberto Garcia 2015-04-29 01:46:36 PDT
I guess something like this might be enough:

--- a/Source/cmake/OptionsCommon.cmake
+++ b/Source/cmake/OptionsCommon.cmake
@@ -57,6 +57,7 @@ if (WTF_CPU_ARM64_CORTEXA53)
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfix-cortex-a53-835769")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfix-cortex-a53-835769")
         message(STATUS "Enabling Cortex-A53 workaround for compiler")
+        set(USE_LD_GOLD OFF)
     endif ()
 endif ()
Comment 8 Csaba Osztrogonác 2015-04-29 02:01:52 PDT
I think I found the root of the problem. This errata detection is placed
before the gold linker detection. It tries to detect if the default
system linker supports --fix-cortex-a53-835769 and later uses gold
linker for the real build.

Do we know why only the BFD linker supports this errata fix?
Is there a gold linker version which supports it?
Comment 9 Csaba Osztrogonác 2015-04-29 04:21:03 PDT
new bug report for this issue: bug144382