Bug 138840

Summary: Incorrect detection of toolchain support for Cortex-A53 erratum 835769 workaround
Product: WebKit Reporter: Akos Kiss <akiss>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, commit-queue, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch. none

Akos Kiss
Reported 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.
Attachments
Proposed patch. (1.61 KB, patch)
2014-11-18 11:46 PST, Akos Kiss
no flags
Akos Kiss
Comment 1 2014-11-18 11:46:31 PST
Created attachment 241797 [details] Proposed patch.
Csaba Osztrogonác
Comment 2 2014-11-19 00:26:52 PST
Comment on attachment 241797 [details] Proposed patch. r=me
WebKit Commit Bot
Comment 3 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>
WebKit Commit Bot
Comment 4 2014-11-19 01:06:43 PST
All reviewed patches have been landed. Closing bug.
Alberto Garcia
Comment 5 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
Csaba Osztrogonác
Comment 6 2015-04-29 01:33:35 PDT
Thanks for the report, I'll check and try to fix it soon.
Alberto Garcia
Comment 7 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 ()
Csaba Osztrogonác
Comment 8 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?
Csaba Osztrogonác
Comment 9 2015-04-29 04:21:03 PDT
new bug report for this issue: bug144382
Note You need to log in before you can comment on or make changes to this bug.