Skip to content

Commit

Permalink
AOSP: Move system_shared_libs into target.bionic clause
Browse files Browse the repository at this point in the history
Use target.bionic.system_shared_libs when it is used to limit the
default shared libraries (as opposed to remove them completely).
This avoids attempting to add a host dependency on libc when
system_shared_libs is modified to apply to all variants.

Also remove system_shared_libs from static binaries where it has
no effect, and consolidate it into e2fsprogs-defaults.

Bug: 193559105
Test: m checkbuild
Change-Id: I2d447b006afc783f4acd6c1acd93f338a68a01ed
From AOSP commit: 48fa724
  • Loading branch information
colincross authored and tytso committed Jul 27, 2021
1 parent 3e3403d commit 59eed54
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 17 deletions.
3 changes: 3 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ cc_defaults {
"-Wno-unused-variable",
],
},
bionic: {
system_shared_libs: ["libc", "libdl"],
},
},
}

Expand Down
1 change: 0 additions & 1 deletion contrib/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ cc_binary {
"libext2fs",
"libext2_com_err",
],
system_shared_libs: ["libc", "libdl"],
}
1 change: 0 additions & 1 deletion debugfs/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ cc_binary {
defaults: ["debugfs-defaults"],

shared_libs: debugfs_libs,
system_shared_libs: ["libc", "libdl"],
}

cc_binary {
Expand Down
2 changes: 0 additions & 2 deletions e2fsck/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ cc_binary {
defaults: ["e2fsck-defaults"],

shared_libs: e2fsck_libs,
system_shared_libs: ["libc", "libdl"],
required: ["badblocks"],
}

Expand All @@ -87,6 +86,5 @@ cc_binary {
static_executable: true,
ramdisk: true,
defaults: ["e2fsck-defaults"],
system_shared_libs: [],
static_libs: e2fsck_libs,
}
11 changes: 0 additions & 11 deletions misc/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ cc_library {
"libext2_com_err",
"libext2_quota",
],
system_shared_libs: ["libc", "libdl"],
export_include_dirs: ["."],
}

Expand Down Expand Up @@ -145,7 +144,6 @@ cc_binary {
defaults: ["tune2fs-defaults"],

shared_libs: tune2fs_libs,
system_shared_libs: ["libc", "libdl"],
}

cc_binary {
Expand All @@ -162,7 +160,6 @@ cc_binary {
static_executable: true,
ramdisk: true,
defaults: ["tune2fs-defaults"],
system_shared_libs: [],
static_libs: tune2fs_libs,
}

Expand Down Expand Up @@ -190,7 +187,6 @@ cc_binary {
"libext2_blkid",
"libext2_e2p",
],
system_shared_libs: ["libc", "libdl"],
}

//########################################################################
Expand All @@ -206,7 +202,6 @@ cc_binary {
"libext2_com_err",
"libext2_e2p",
],
system_shared_libs: ["libc", "libdl"],
}

//########################################################################
Expand All @@ -229,7 +224,6 @@ cc_binary {
defaults: ["lsattr-defaults"],

shared_libs: lsattr_libs,
system_shared_libs: ["libc", "libdl"],
}

cc_binary {
Expand All @@ -254,7 +248,6 @@ cc_binary {
"libext2_com_err",
"libext2_e2p",
],
system_shared_libs: ["libc", "libdl"],
}

//########################################################################
Expand All @@ -270,7 +263,6 @@ cc_binary {
"libext2fs",
"libext2_uuid",
],
system_shared_libs: ["libc", "libdl"],

target: {
darwin: {
Expand All @@ -294,7 +286,6 @@ cc_binary {
"libext2_com_err",
"libext2_quota",
],
system_shared_libs: ["libc", "libdl"],
}

//##########################################################################
Expand All @@ -309,7 +300,6 @@ cc_binary {
shared_libs: [
"libext2fs",
],
system_shared_libs: ["libc", "libdl"],
}

//##########################################################################
Expand All @@ -328,5 +318,4 @@ cc_binary {
"libext2fs",
"libext2_com_err",
],
system_shared_libs: ["libc", "libdl"],
}
2 changes: 0 additions & 2 deletions resize/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ cc_binary {
shared_libs: resize2fs_libs,
},
},
system_shared_libs: ["libc", "libdl"],
}

cc_binary {
Expand All @@ -55,6 +54,5 @@ cc_binary {
static_executable: true,
ramdisk: true,
defaults: ["resize2fs-defaults"],
system_shared_libs: [],
static_libs: resize2fs_libs,
}

0 comments on commit 59eed54

Please sign in to comment.