diff --git a/build-linux b/build-linux index a49f6f6..773775f 100755 --- a/build-linux +++ b/build-linux @@ -102,7 +102,7 @@ Run `make modules_install` after `make`. 'make', LF, '-j', str(self.env['nproc']), LF, 'ARCH={}'.format(self.env['linux_arch']), LF, - 'CROSS_COMPILE={}-'.format(self.env['toolchain_prefix']), LF, + 'CROSS_COMPILE={}'.format(self.env['toolchain_prefix_dash']), LF, 'CC={}'.format(cc), LF, 'O={}'.format(build_dir), LF, ] + verbose diff --git a/build-modules b/build-modules index 6f1b344..bef0bfb 100755 --- a/build-modules +++ b/build-modules @@ -102,7 +102,7 @@ Place the modules on a separate magic directory from non --host builds. 'ARCH={}'.format(self.env['linux_arch']), LF, 'CC={}'.format(cc), LF, 'CCFLAGS={}'.format(self.sh.cmd_to_string(ccflags)), LF, - 'CROSS_COMPILE={}-'.format(self.env['toolchain_prefix']), LF, + 'CROSS_COMPILE={}'.format(self.env['toolchain_prefix_dash']), LF, 'LINUX_DIR={}'.format(linux_dir), LF, 'M={}'.format(build_subdir), LF, 'OBJECT_FILES={}'.format(' '.join(object_files)), LF, diff --git a/common.py b/common.py index 94f011b..dcb5b27 100644 --- a/common.py +++ b/common.py @@ -949,7 +949,10 @@ lunch aosp_{}-eng env['crosstool_ng_toolchain_prefix'] ) elif env['gcc_which'] == 'host': - env['toolchain_prefix'] = env['ubuntu_toolchain_prefix'] + if env['arch'] == env['host_arch']: + env['toolchain_prefix'] = '' + else: + env['toolchain_prefix'] = env['ubuntu_toolchain_prefix'] if env['arch'] == 'x86_64': env['userland_library_dir'] = '/' elif env['arch'] == 'arm': @@ -964,6 +967,10 @@ lunch aosp_{}-eng raise Exception('There is no host baremetal chain for arch: ' + env['arch']) else: raise Exception('Unknown toolchain: ' + env['gcc_which']) + if env['toolchain_prefix'] == '': + env['toolchain_prefix_dash'] = '' + else: + env['toolchain_prefix_dash'] = '{}-'.format(env['toolchain_prefix']) env['gcc_path'] = self.get_toolchain_tool('gcc') env['gxx_path'] = self.get_toolchain_tool('g++') env['ld_path'] = self.get_toolchain_tool('ld') @@ -1062,7 +1069,7 @@ lunch aosp_{}-eng return ret def get_toolchain_tool(self, tool): - return '{}-{}'.format(self.env['toolchain_prefix'], tool) + return '{}{}'.format(self.env['toolchain_prefix_dash'], tool) def github_make_request( self,