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

Side by Side Diff: tests/toolchain/nacl.scons

Issue 508823007: Expose LLC's -force-align-stack flag to pnacl-translate (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: review Created 6 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/toolchain/call_with_misaligned_stack.S ('k') | tests/toolchain/stackalign_test.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- python -*- 1 # -*- python -*-
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 Import('env') 6 Import('env')
7 7
8 # force inclusion of entire library, so that we can validate it 8 # force inclusion of entire library, so that we can validate it
9 # NOTE: This approach does not work for -lc because of tons of 9 # NOTE: This approach does not work for -lc because of tons of
10 # undefined symbols which would have to be stubbed out 10 # undefined symbols which would have to be stubbed out
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 env.ComponentLibrary('wrap_lib', ['wrap_lib1.c', 'wrap_lib2.c']) 548 env.ComponentLibrary('wrap_lib', ['wrap_lib1.c', 'wrap_lib2.c'])
549 nexe = env.ComponentProgram('wrap', ['wrap_main.c'], 549 nexe = env.ComponentProgram('wrap', ['wrap_main.c'],
550 EXTRA_LINKFLAGS=WRAP_LINK_FLAGS, 550 EXTRA_LINKFLAGS=WRAP_LINK_FLAGS,
551 EXTRA_LIBS=['wrap_lib', '${NONIRT_LIBS}']) 551 EXTRA_LIBS=['wrap_lib', '${NONIRT_LIBS}'])
552 node = env.CommandSelLdrTestNacl('wrap.out', nexe, 552 node = env.CommandSelLdrTestNacl('wrap.out', nexe,
553 stdout_golden=env.File('wrap.stdout')) 553 stdout_golden=env.File('wrap.stdout'))
554 env.AddNodeToTestSuite(node, ['toolchain_tests','small_tests'], 'run_wrap_test') 554 env.AddNodeToTestSuite(node, ['toolchain_tests','small_tests'], 'run_wrap_test')
555 555
556 if (env.Bit('target_x86_32') and env.Bit('bitcode') and 556 if (env.Bit('target_x86_32') and env.Bit('bitcode') and
557 not env.Bit('pnacl_generate_pexe') and 557 not env.Bit('pnacl_generate_pexe') and
558 env['TOOLCHAIN_FEATURE_VERSION'] >= 7): 558 env['TOOLCHAIN_FEATURE_VERSION'] >= 8):
559 # This test compiles a file that will need to generate a call to a compiler-rt 559 # This test compiles a file that will need to generate a call to a compiler-rt
560 # function (__udivdi3) on x86-32. Ensure that when we pre-translate to a 560 # function (__udivdi3) on x86-32. Ensure that when we pre-translate to a
561 # native object file, libgcc is included in the bitcode link to satisfy the 561 # native object file, libgcc is included in the bitcode link to satisfy the
562 # reference. 562 # reference.
563 mixedlink_env = env.Clone() 563 mixedlink_env = env.Clone()
564 mixedlink_env.Append(CCFLAGS=['--pnacl-allow-translate', 564 mixedlink_env.Append(CCFLAGS=['--pnacl-allow-translate',
565 '--pnacl-allow-native', 565 '--pnacl-allow-native',
566 '-arch', 'x86-32']) 566 '-arch', 'x86-32'])
567 mixedlink_env.Append(LINKFLAGS=['--pnacl-allow-translate', 567 mixedlink_env.Append(LINKFLAGS=['--pnacl-allow-translate',
568 '--pnacl-allow-native', 568 '--pnacl-allow-native',
569 '-arch', 'x86-32']) 569 '-arch', 'x86-32'])
570
570 nexe = mixedlink_env.ComponentProgram('libgcc_mixed_link', 'needs_libgcc.c', 571 nexe = mixedlink_env.ComponentProgram('libgcc_mixed_link', 'needs_libgcc.c',
571 EXTRA_LIBS=['${NONIRT_LIBS}']) 572 EXTRA_LIBS=['${NONIRT_LIBS}'])
572 node = mixedlink_env.CommandSelLdrTestNacl('libgcc_mixed_link.out', nexe, 573 node = mixedlink_env.CommandSelLdrTestNacl('libgcc_mixed_link.out', nexe,
573 ['9', '3']) 574 ['9', '3'])
574 mixedlink_env.AddNodeToTestSuite(node, ['nonpexe_tests', 'small_tests'], 575 mixedlink_env.AddNodeToTestSuite(node, ['nonpexe_tests', 'small_tests',
576 'toolchain_tests'],
575 'run_libgcc_mixed_link_test') 577 'run_libgcc_mixed_link_test')
578
579 # This tests the translator's -force-align-stack flag, which means that the
580 # compiler cannot assume that the stack pointer is aligned to a 16-byte
581 # boundary, and must force realignment on entry to each function.
582 mixedlink_env.Append(ASFLAGS=['-arch', 'x86-32'])
583 mixedlink_env.Append(CCFLAGS=['-Wt,-force-align-stack'])
584 nexe = mixedlink_env.ComponentProgram(
585 'stackalign_test',
586 ['call_with_misaligned_stack.S', 'stackalign_test.c'],
587 EXTRA_LIBS=['${NONIRT_LIBS}'])
588 node = mixedlink_env.CommandSelLdrTestNacl('stackalign.out', nexe)
589 mixedlink_env.AddNodeToTestSuite(
590 node,
591 ['nonpexe_tests', 'small_tests', 'toolchain_tests'],
592 'run_stackalign_test')
OLDNEW
« no previous file with comments | « tests/toolchain/call_with_misaligned_stack.S ('k') | tests/toolchain/stackalign_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698