From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 249851A1DEB for ; Tue, 2 Aug 2016 07:51:54 -0700 (PDT) Received: by mail-wm0-x243.google.com with SMTP id o80so31310600wme.0 for ; Tue, 02 Aug 2016 07:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DsgoW+q+wWfKBb4rviLdUbW2fglj5Xm3xHLkPMo9+us=; b=vr2hvxyLfAdbM/JUJe2XUYMP9Ym9fiShX3cUjwE+UqX1ig3HgGZNnUzJ0AsLoDJkFa DnRVjH8Xxaeyub95EseR5htP2wOBuHm+eJVYdqWud1hTuB0XI+qcERYGnnMF9rxDIGOc XWH7lhGG/Io9uMpFRkwHeICW2CAysAXtUFnIH6su1Ml2nANyARnAoA4ozg4/PyOzM1N3 L1h9oGVSm8Wfg28lpAHydcNauGfBF5ArKdI9dcwHCwzUcDBQ/f5UcR6nGbqIBb3OZTGh kAzYXUAUUml+5uAi1idzFhtxvTob4U8M6MU4h3Ppnmi38nsz3o7b5406yHfTtv3oNZiL 6zcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DsgoW+q+wWfKBb4rviLdUbW2fglj5Xm3xHLkPMo9+us=; b=hVrfChQFiS9N3v+IbcdpvNKmFgrptUaMLyq7qiRSc0gy2iC2aetT3Zzcfe6k0z+CDV A9cfImiP5ruuCnfSEmxgiJq4CyVzCrreORknFIg2W8v2wjY0mfTY0nckb9hyrLRjgkW3 TNNMdV5mRuqF+d3P3MUucoP9d0rRE8t9w1S4zzQ/GVAL3irycVF2u1TpXzMO17QJWBn3 vu+/OWhFShDbm0sXTjcOAJ9oD+ZYZvVsJCa/8y4fcmV5f4CwdWTg3jWHGruvi+Oj5Dw5 bNDXBFhFkVacKpbS/V7fMTKN/nNL8PROC5c9/FZDpgX9iLm9UDwGap6i26LmE0sTrQO5 zyVg== X-Gm-Message-State: AEkoouuy2o1OyRGvB0ERBSKJUj/B5/n/1PYAXPvjLZsSUUghhXXGq4ja7i9Hj91v115ZkkCbjkRBotcYrmkFvw== X-Received: by 10.28.221.8 with SMTP id u8mr60772278wmg.61.1470149512621; Tue, 02 Aug 2016 07:51:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.238.198 with HTTP; Tue, 2 Aug 2016 07:51:51 -0700 (PDT) In-Reply-To: References: <1470038497-2536-1-git-send-email-ard.biesheuvel@linaro.org> <06C8AB66E78EE34A949939824ABE2B3103383880@shsmsx102.ccr.corp.intel.com> From: Michael Zimmermann Date: Tue, 2 Aug 2016 16:51:51 +0200 Message-ID: To: Ard Biesheuvel Cc: "Shi, Steven" , "Justen, Jordan L" , edk2-devel-01 , Leif Lindholm , "Gao, Liming" , Laszlo Ersek X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [PATCH v5 0/8] BaseTools: add support for GCC5 in LTO mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2016 14:51:54 -0000 Content-Type: text/plain; charset=UTF-8 > sry but I have to retest everything since I aciidentally checked out a wrong revision. will report back later. ignore this, everything in my report was correct. got confused with CommitDate vs AuthorDate. > Only 0x4 or 0x9 or others as well? This is relevent since 0x4 is a PLT relocation which can be fixed up easily. The GOT based ones are trickier since they involve a GOT entry with an absolute symbol address that needs to be fixed up by the PE/COFF loader Only 0x4. > Interesting. I wonder where the first memmove resp. memset are coming from. Are you linking with libgcc are sth like that? I was able to fix memmove with this patch: diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S index 79f95b0..5833814 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S +++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S @@ -14,7 +14,6 @@ .text .align 2 - GCC_ASM_EXPORT (memmove) # VOID # EFIAPI no idea about memset, but when I hacked it away by just removing the export from the CompilerIntrinsicsLib, the error was gone, but the 'plugin needed to handle lto object' errors were still there. Thanks Michael On Tue, Aug 2, 2016 at 4:46 PM, Michael Zimmermann wrote: > sry but I have to retest everything since I aciidentally checked out a > wrong revision. > will report back later. > > On Tue, Aug 2, 2016 at 4:39 PM, Michael Zimmermann < > sigmaepsilon92@gmail.com> wrote: > >> Sry for the late reply but I tried your latest gcc-lto branch to make >> sure my answers are still correct. >> I tested it with all configurations(StdLib:X64/ARM, Ovmf:X64, >> ArmVirtPkg:ARM with both RELEASE and DEBUG). >> In StdLib are many warnings actually. That's because >> of -Wunused-const-variable and -Wmisleading-indentation. >> Also I had to apply the commit to fix 'Unsupported ELF EM_X86_64 >> relocation 0x4.' for X64. >> >> '-b RELEASE -a ARM -t GCC5 -p AppPkg/AppPkg.dsc' is the only >> configuration I can't get to compile with gcc6(DEBUG works): >> /tmp/ccYJi1bO.ltrans0.ltrans.o: In function `memmove': >> :(.text+0x3670): multiple definition of `memmove' >> /media/Data/repositories/git/efidroid/testing/linuxtoolchain/edk2/Build/AppPkg/RELEASE_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib/OUTPUT/CompilerIntrinsicsLib.lib(memmove.obj):(.text+0x0): >> first defined here >> /tmp/ccYJi1bO.ltrans0.ltrans.o: In function `memset': >> :(.text+0x3674): multiple definition of `memset' >> /media/Data/repositories/git/efidroid/testing/linuxtoolchain/edk2/Build/AppPkg/RELEASE_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib/OUTPUT/CompilerIntrinsicsLib.lib(memset.obj):(.text+0x10): >> first defined here >> >> /media/Data/repositories/git/efidroid/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.1.1~linaro-gcc-6-branch@f3888e76-20160721-x86_64_arm-eabi/bin/../lib/gcc/arm-eabi/6.1.1/../../../../arm-eabi/bin/ld: >> printf.obj: plugin needed to handle lto object >> >> /media/Data/repositories/git/efidroid/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.1.1~linaro-gcc-6-branch@f3888e76-20160721-x86_64_arm-eabi/bin/../lib/gcc/arm-eabi/6.1.1/../../../../arm-eabi/bin/ld: >> puts.obj: plugin needed to handle lto object >> >> /media/Data/repositories/git/efidroid/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.1.1~linaro-gcc-6-branch@f3888e76-20160721-x86_64_arm-eabi/bin/../lib/gcc/arm-eabi/6.1.1/../../../../arm-eabi/bin/ld: >> internal error >> /media/Data/repositories/git/abe/_build/snapshots/binutils-gdb.git~linaro_binutils-2_26-branch/ld/ldlang.c >> 6299 >> collect2: error: ld returned 1 exit status >> make: *** [GNUmakefile:417: >> /media/Data/repositories/git/efidroid/testing/linuxtoolchain/edk2/Build/AppPkg/RELEASE_GCC5/ARM/AppPkg/Applications/Main/Main/DEBUG/Main.dll] >> Error 1 >> >> Also, I only did compilation tests, I didn't try to run any of the >> produced binaries. >> >> this is the fixed branch: >> https://github.com/M1cha/edk2/commits/edk2-master-gcc6 >> it's based on your gcc5-lto-v6 branch. >> >> Thanks >> Michael >> >> On Tue, Aug 2, 2016 at 3:56 PM, Ard Biesheuvel > > wrote: >> >>> On 2 August 2016 at 15:55, Michael Zimmermann >>> wrote: >>> > btw, gcc6 seems to work fine too with these patches(it did with the >>> GCC49 >>> > configs too on both ARM and x86/x64). >>> > >>> >>> Thanks for the data points. Do you see any warnings during the build? >>> >> >> >