Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions clang/lib/Driver/ToolChains/BareMetal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,9 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
}

Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
options::OPT_s, options::OPT_t, options::OPT_r});
Args.addAllArgs(CmdArgs,
{options::OPT_L, options::OPT_u, options::OPT_T_Group,
options::OPT_s, options::OPT_t, options::OPT_r});

TC.AddFilePathLibArgs(Args, CmdArgs);

Expand Down
14 changes: 14 additions & 0 deletions clang/test/Driver/baremetal-undefined-symbols.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Check the arguments are correctly passed

// Make sure -T is the last with gcc-toolchain option
// RUN: %clang -### --target=riscv32 --gcc-toolchain= -Xlinker --defsym=FOO=10 -T a.lds -u foo %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-LD %s
// CHECK-LD: {{.*}} "--defsym=FOO=10" {{.*}} "-u" "foo" {{.*}} "-T" "a.lds"

// TODO: Merge this test with the above in the last patch when finally integrating riscv
// Make sure -T is the last with gcc-toolchain option
// RUN: %clang -### --target=aarch64-none-elf --gcc-toolchain= -Xlinker --defsym=FOO=10 -T a.lds -u foo %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ARM-LD %s
// RUN: %clang -### --target=armv6m-none-eabi --gcc-toolchain= -Xlinker --defsym=FOO=10 -T a.lds -u foo %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ARM-LD %s
// CHECK-ARM-LD: {{.*}} "-T" "a.lds" "-u" "foo" {{.*}} "--defsym=FOO=10"
6 changes: 0 additions & 6 deletions clang/test/Driver/riscv-args.c

This file was deleted.