diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2019-04-15 23:03:38 -0700 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2019-04-16 16:22:03 -0700 |
commit | 6d8c0a50bc3903f90935e5163e1b9bb46a30d5a9 (patch) | |
tree | 7ff5fb061d38be76c569e5d817a1efdfaf1901b4 /cc/binary.go | |
parent | 819635624843ae286cefae6a9a89d3d90ed61cd8 (diff) | |
download | build_soong-6d8c0a50bc3903f90935e5163e1b9bb46a30d5a9.tar.gz build_soong-6d8c0a50bc3903f90935e5163e1b9bb46a30d5a9.tar.bz2 build_soong-6d8c0a50bc3903f90935e5163e1b9bb46a30d5a9.zip |
Revert "Revert "Enable lld for windows""
This reverts commit 61166dc047ff30869667a58cf0daca68d20e38ab.
One difference from the earlier change is that import libraries are now
using the '.lib' extension instead of '.a' to prevent clash with
AdbWinApi.a.
Bug: http://b/110800681
The following flags that the binutils linkers support are not
available in lld for Windows:
-soname
--no-undefined
-rpath
Windows also uses "import libraries", which are stub libraries used only
for linking. The binutils linkers accepted a DLL and treated them as an
import library. But lld issues the following error:
lld-link: error: ...DLL: bad file type. Did you specify a DLL instead
of an import library?
To resolve this, pass '-out-implib=libFoo.lib' to lld when linking
libFoo.dll to get lld to generate an import library. Add libFoo.lib as
an implicit output to the 'ld' build rule.
Rewrite the shared libraries when building a library/binary to use the
import library instead of the DLL. As a side-effect, this also uses the
newly-created AdbWinApi.lib that's alongside
development/host/windows/prebuilt/usb/AdbWinApi.dll
Test: Run Windows tests (go/android-llvm-windows-testing) and check
absence of regressions. Also check that the following commands pass:
$ adb.exe devices
$ fastboot.exe devices
Change-Id: I34e07d345e0207086ac8e8ea12525d8c322b20fd
Diffstat (limited to 'cc/binary.go')
-rw-r--r-- | cc/binary.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cc/binary.go b/cc/binary.go index 35c3d85d..51e68fcd 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -384,7 +384,7 @@ func (binary *binaryDecorator) link(ctx ModuleContext, TransformObjToDynamicBinary(ctx, objs.objFiles, sharedLibs, deps.StaticLibs, deps.LateStaticLibs, deps.WholeStaticLibs, linkerDeps, deps.CrtBegin, deps.CrtEnd, true, - builderFlags, outputFile) + builderFlags, outputFile, nil) objs.coverageFiles = append(objs.coverageFiles, deps.StaticLibObjs.coverageFiles...) objs.coverageFiles = append(objs.coverageFiles, deps.WholeStaticLibObjs.coverageFiles...) |