cmd_args.extend(arglist.renderAsInput(arg))
else:
# Perform argument translation for LLVM backend. This
- # performs some care in reconciling with llvm-gcc. The
+ # takes some care in reconciling with llvm-gcc. The
# issue is that llvm-gcc translates these options based on
# the values in cc1, whereas we are processing based on
# the driver arguments.
if (archName == 'x86_64' or
picEnabled):
cmd_args.append('--relocation-model=pic')
- else:
+ elif not arglist.getLastArg(arglist.parser.m_dynamicNoPicOption):
cmd_args.append('--relocation-model=static')
if arglist.getLastArg(arglist.parser.f_timeReportOption):
--- /dev/null
+// Check that object files compiled with -mdynamic-no-pic can be
+// linked.
+//
+// RUN: xcc -ccc-clang -m32 -mdynamic-no-pic %s -c -o %t.o &&
+// RUN: xcc -ccc-clang -m32 %t.o -o %t &&
+// RUN: %t | grep "Hello, World" &&
+// RUN: xcc -ccc-clang -m64 -mdynamic-no-pic %s -c -o %t.o &&
+// RUN: xcc -ccc-clang -m64 %t.o -o %t &&
+// RUN: %t | grep "Hello, World" &&
+// RUN: true
+
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+ fprintf(stdout, "Hello, World");
+ return 0;
+}