Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: toolchain_build/toolchain_build.py

Issue 11363043: Finish details of newlib install (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « toolchain_build/command.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: toolchain_build/toolchain_build.py
diff --git a/toolchain_build/toolchain_build.py b/toolchain_build/toolchain_build.py
index ea9c8795a0db7c8945f2d96a7600ff27953635dd..53dae5ead26a9474126ab9963c02a35a0996b7ad 100755
--- a/toolchain_build/toolchain_build.py
+++ b/toolchain_build/toolchain_build.py
@@ -62,10 +62,32 @@ CONFIGURE_HOST_TOOL = CONFIGURE_HOST_LIB + [
'--without-zlib',
]
+
+def NewlibLibcScript(arch):
+ template = """/*
+ * This is a linker script that gets installed as libc.a for the
+ * newlib-based NaCl toolchain. It brings in the constituent
+ * libraries that make up what -lc means semantically.
+ */
+OUTPUT_FORMAT(%s)
+GROUP ( libcrt_common.a libnacl.a )
+"""
+ if arch == 'arm':
+ # Listing three formats instead of one makes -EL/-EB switches work
+ # for the endian-switchable ARM backend.
+ format_list = ['elf32-littlearm-nacl',
+ 'elf32-bigarm-nacl',
+ 'elf32-littlearm-nacl']
+ else:
+ raise Exception('TODO(mcgrathr): OUTPUT_FORMAT for %s' % arch)
+ return template % ', '.join(['"' + fmt + '"' for fmt in format_list])
+
+
def ConfigureTargetArgs(arch):
config_target = arch + '-nacl'
return ['--target=' + config_target, '--with-sysroot=/' + config_target]
+
def CommandsInBuild(command_lines):
return [command.Mkdir('build')] + [command.Command(cmd, cwd='build')
for cmd in command_lines]
@@ -265,6 +287,9 @@ def TargetLibs(target):
newlib_sys_nacl,
]))
+ def NewlibFile(subdir, name):
+ return os.path.join('%(output)s', target + '-nacl', subdir, name)
+
libs = {
'newlib_' + target: {
'dependencies': lib_deps,
@@ -286,11 +311,13 @@ def TargetLibs(target):
],
MAKE_PARALLEL_CMD,
MAKE_DESTDIR_CMD + ['install-strip'],
- # TODO(mcgrathr): Needs some additional steps:
- # rm pthread.h
- # mv libc.a libcrt_common.a
- # Write libc.a with linker script text.
- ]),
+ ]) + [
+ command.Remove(NewlibFile('include', 'pthread.h')),
+ command.Rename(NewlibFile('lib', 'libc.a'),
+ NewlibFile('lib', 'libcrt_common.a')),
+ command.WriteData(NewlibLibcScript(target),
+ NewlibFile('lib', 'libc.a')),
+ ],
},
# TODO(mcgrathr): gcc_libs
« no previous file with comments | « toolchain_build/command.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698