diff options
author | Colin Cross <ccross@android.com> | 2016-07-13 18:55:43 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2016-07-13 18:55:43 -0700 |
commit | f87b261ceb77e587a191e2360f59de5707c3eb1f (patch) | |
tree | 6fc32ae2e30d35ba597768ea14e5634f0a81f62a /cc | |
parent | e6c7f1836499a1544c94964e0b87d2dfdb3b92d4 (diff) | |
download | build_soong-f87b261ceb77e587a191e2360f59de5707c3eb1f.tar.gz build_soong-f87b261ceb77e587a191e2360f59de5707c3eb1f.tar.bz2 build_soong-f87b261ceb77e587a191e2360f59de5707c3eb1f.zip |
Put shared library ldflags first
Some obscure modules (like libtest_with_dependency_loop_b_tmp in
bionic/tests/libs/Android.bp) need to override shared library flags like
-Wl,-soname. Put the defaults first so that the module specific ones
can override them.
Change-Id: Icde9ca2cf76c4f3e3218b6b22033bc81a6755b57
Diffstat (limited to 'cc')
-rw-r--r-- | cc/cc.go | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1491,7 +1491,7 @@ type flagExporter struct { func (f *flagExporter) exportIncludes(ctx ModuleContext, inc string) { includeDirs := android.PathsForModuleSrc(ctx, f.Properties.Export_include_dirs) for _, dir := range includeDirs.Strings() { - f.flags = append(f.flags, inc + dir) + f.flags = append(f.flags, inc+dir) } } @@ -1613,26 +1613,28 @@ func (library *libraryLinker) flags(ctx ModuleContext, flags Flags) Flags { if flags.Clang || ctx.Host() { sharedFlag = "-shared" } + var f []string if ctx.Device() { - flags.LdFlags = append(flags.LdFlags, + f = append(f, "-nostdlib", "-Wl,--gc-sections", ) } if ctx.Darwin() { - flags.LdFlags = append(flags.LdFlags, + f = append(f, "-dynamiclib", "-single_module", //"-read_only_relocs suppress", "-install_name @rpath/"+libName+flags.Toolchain.ShlibSuffix(), ) } else { - flags.LdFlags = append(flags.LdFlags, + f = append(f, sharedFlag, - "-Wl,-soname,"+libName+flags.Toolchain.ShlibSuffix(), - ) + "-Wl,-soname,"+libName+flags.Toolchain.ShlibSuffix()) } + + flags.LdFlags = append(f, flags.LdFlags...) } return flags |