Commit 82ae9cbe authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Fix Android scons build by putting -lv8 before -lgcc.

Review URL: http://codereview.chromium.org/1275001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 54f0a5b2
...@@ -90,7 +90,7 @@ ANDROID_LINKFLAGS = ['-nostdlib', ...@@ -90,7 +90,7 @@ ANDROID_LINKFLAGS = ['-nostdlib',
'-Wl,-z,nocopyreloc', '-Wl,-z,nocopyreloc',
'-Wl,-rpath-link=' + ANDROID_TOP + '/out/target/product/generic/obj/lib', '-Wl,-rpath-link=' + ANDROID_TOP + '/out/target/product/generic/obj/lib',
ANDROID_TOP + '/out/target/product/generic/obj/lib/crtbegin_dynamic.o', ANDROID_TOP + '/out/target/product/generic/obj/lib/crtbegin_dynamic.o',
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a', ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a',
ANDROID_TOP + '/out/target/product/generic/obj/lib/crtend_android.o']; ANDROID_TOP + '/out/target/product/generic/obj/lib/crtend_android.o'];
LIBRARY_FLAGS = { LIBRARY_FLAGS = {
...@@ -371,7 +371,6 @@ DTOA_EXTRA_FLAGS = { ...@@ -371,7 +371,6 @@ DTOA_EXTRA_FLAGS = {
CCTEST_EXTRA_FLAGS = { CCTEST_EXTRA_FLAGS = {
'all': { 'all': {
'CPPPATH': [join(root_dir, 'src')], 'CPPPATH': [join(root_dir, 'src')],
'LIBS': ['$LIBRARY']
}, },
'gcc': { 'gcc': {
'all': { 'all': {
...@@ -401,9 +400,10 @@ CCTEST_EXTRA_FLAGS = { ...@@ -401,9 +400,10 @@ CCTEST_EXTRA_FLAGS = {
'__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
'CCFLAGS': ANDROID_FLAGS, 'CCFLAGS': ANDROID_FLAGS,
'CPPPATH': ANDROID_INCLUDES, 'CPPPATH': ANDROID_INCLUDES,
'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
'LINKFLAGS': ANDROID_LINKFLAGS, 'LINKFLAGS': ANDROID_LINKFLAGS,
'LIBS': ['log', 'c', 'stdc++', 'm'], 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
'mode:release': { 'mode:release': {
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
} }
...@@ -431,7 +431,6 @@ CCTEST_EXTRA_FLAGS = { ...@@ -431,7 +431,6 @@ CCTEST_EXTRA_FLAGS = {
SAMPLE_FLAGS = { SAMPLE_FLAGS = {
'all': { 'all': {
'CPPPATH': [join(abspath('.'), 'include')], 'CPPPATH': [join(abspath('.'), 'include')],
'LIBS': ['$LIBRARY'],
}, },
'gcc': { 'gcc': {
'all': { 'all': {
...@@ -465,9 +464,10 @@ SAMPLE_FLAGS = { ...@@ -465,9 +464,10 @@ SAMPLE_FLAGS = {
'__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
'CCFLAGS': ANDROID_FLAGS, 'CCFLAGS': ANDROID_FLAGS,
'CPPPATH': ANDROID_INCLUDES, 'CPPPATH': ANDROID_INCLUDES,
'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
'LINKFLAGS': ANDROID_LINKFLAGS, 'LINKFLAGS': ANDROID_LINKFLAGS,
'LIBS': ['log', 'c', 'stdc++', 'm'], 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
'mode:release': { 'mode:release': {
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
} }
...@@ -590,9 +590,10 @@ D8_FLAGS = { ...@@ -590,9 +590,10 @@ D8_FLAGS = {
'LIBS': ['pthread'], 'LIBS': ['pthread'],
}, },
'os:android': { 'os:android': {
'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
'LINKFLAGS': ANDROID_LINKFLAGS, 'LINKFLAGS': ANDROID_LINKFLAGS,
'LIBS': ['log', 'c', 'stdc++', 'm'], 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
}, },
'os:win32': { 'os:win32': {
'LIBS': ['winmm', 'ws2_32'], 'LIBS': ['winmm', 'ws2_32'],
...@@ -988,7 +989,6 @@ def BuildSpecific(env, mode, env_overrides): ...@@ -988,7 +989,6 @@ def BuildSpecific(env, mode, env_overrides):
if context.options['soname'] == 'on': if context.options['soname'] == 'on':
# When building shared object with SONAME version the library name. # When building shared object with SONAME version the library name.
library_name += '-' + version library_name += '-' + version
env['LIBRARY'] = library_name
# Generate library SONAME if required by the build. # Generate library SONAME if required by the build.
if context.options['soname'] == 'on': if context.options['soname'] == 'on':
...@@ -1009,6 +1009,7 @@ def BuildSpecific(env, mode, env_overrides): ...@@ -1009,6 +1009,7 @@ def BuildSpecific(env, mode, env_overrides):
# Link the object files into a library. # Link the object files into a library.
env.Replace(**context.flags['v8']) env.Replace(**context.flags['v8'])
env.Prepend(LIBS=[library_name])
context.ApplyEnvOverrides(env) context.ApplyEnvOverrides(env)
if context.options['library'] == 'static': if context.options['library'] == 'static':
...@@ -1028,8 +1029,9 @@ def BuildSpecific(env, mode, env_overrides): ...@@ -1028,8 +1029,9 @@ def BuildSpecific(env, mode, env_overrides):
context.d8_targets.append(shell) context.d8_targets.append(shell)
for sample in context.samples: for sample in context.samples:
sample_env = Environment(LIBRARY=library_name) sample_env = Environment()
sample_env.Replace(**context.flags['sample']) sample_env.Replace(**context.flags['sample'])
sample_env.Prepend(LIBS=[library_name])
context.ApplyEnvOverrides(sample_env) context.ApplyEnvOverrides(sample_env)
sample_object = sample_env.SConscript( sample_object = sample_env.SConscript(
join('samples', 'SConscript'), join('samples', 'SConscript'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment