Merge "Set multilib to all snapshots except header" am: 57a9db7c48
Original change: https://android-review.googlesource.com/c/platform/development/+/1665141 Change-Id: I733c2a41e95d3c936b16b0af32ac3e057463501f
This commit is contained in:
@@ -145,6 +145,8 @@ def convert_json_to_bp_prop(json_path, bp_dir):
|
|||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def is_64bit_arch(arch):
|
||||||
|
return '64' in arch # arm64, x86_64
|
||||||
|
|
||||||
def gen_bp_module(image, variation, name, version, target_arch, arch_props, bp_dir):
|
def gen_bp_module(image, variation, name, version, target_arch, arch_props, bp_dir):
|
||||||
prop = {
|
prop = {
|
||||||
@@ -174,6 +176,7 @@ def gen_bp_module(image, variation, name, version, target_arch, arch_props, bp_d
|
|||||||
del common_prop[arch_prop_key]
|
del common_prop[arch_prop_key]
|
||||||
prop.update(common_prop)
|
prop.update(common_prop)
|
||||||
|
|
||||||
|
has32 = has64 = False
|
||||||
stem32 = stem64 = ''
|
stem32 = stem64 = ''
|
||||||
|
|
||||||
for arch in arch_props:
|
for arch in arch_props:
|
||||||
@@ -181,27 +184,34 @@ def gen_bp_module(image, variation, name, version, target_arch, arch_props, bp_d
|
|||||||
if k in arch_props[arch]:
|
if k in arch_props[arch]:
|
||||||
del arch_props[arch][k]
|
del arch_props[arch][k]
|
||||||
prop['arch'][arch] = arch_props[arch]
|
prop['arch'][arch] = arch_props[arch]
|
||||||
# Record stem for executable binary snapshots.
|
|
||||||
|
has64 |= is_64bit_arch(arch)
|
||||||
|
has32 |= not is_64bit_arch(arch)
|
||||||
|
|
||||||
|
# Record stem for snapshots.
|
||||||
# We don't check existence of 'src'; src must exist for executables
|
# We don't check existence of 'src'; src must exist for executables
|
||||||
if variation == 'binary':
|
if variation == 'binary':
|
||||||
if '64' in arch: # arm64, x86_64
|
if is_64bit_arch(arch):
|
||||||
stem64 = os.path.basename(arch_props[arch]['src'])
|
stem64 = os.path.basename(arch_props[arch]['src'])
|
||||||
else:
|
else:
|
||||||
stem32 = os.path.basename(arch_props[arch]['src'])
|
stem32 = os.path.basename(arch_props[arch]['src'])
|
||||||
|
|
||||||
# For binary snapshots, compile_multilib must be assigned to 'both'
|
# header snapshots doesn't need compile_multilib. The other snapshots,
|
||||||
# in order to install both. Prefer 64bit if their stem collide and
|
# shared/static/object/binary snapshots, do need them
|
||||||
# installing both is impossible
|
if variation != 'header':
|
||||||
if variation == 'binary':
|
if has32 and has64:
|
||||||
if stem32 and stem64:
|
prop['compile_multilib'] = 'both'
|
||||||
if stem32 == stem64:
|
elif has32:
|
||||||
prop['compile_multilib'] = 'first'
|
|
||||||
else:
|
|
||||||
prop['compile_multilib'] = 'both'
|
|
||||||
elif stem32:
|
|
||||||
prop['compile_multilib'] = '32'
|
prop['compile_multilib'] = '32'
|
||||||
elif stem64:
|
elif has64:
|
||||||
prop['compile_multilib'] = '64'
|
prop['compile_multilib'] = '64'
|
||||||
|
else:
|
||||||
|
raise RuntimeError("Module %s doesn't have prebuilts." % name)
|
||||||
|
|
||||||
|
# For binary snapshots, prefer 64bit if their stem collide and installing
|
||||||
|
# both is impossible
|
||||||
|
if variation == 'binary' and stem32 == stem64:
|
||||||
|
prop['compile_multilib'] = 'first'
|
||||||
|
|
||||||
bp = '%s_snapshot_%s {\n' % (image, variation)
|
bp = '%s_snapshot_%s {\n' % (image, variation)
|
||||||
bp += gen_bp_prop(prop, INDENT)
|
bp += gen_bp_prop(prop, INDENT)
|
||||||
|
|||||||
Reference in New Issue
Block a user