Index: ELF/LinkerScript.cpp =================================================================== --- ELF/LinkerScript.cpp +++ ELF/LinkerScript.cpp @@ -1249,6 +1249,9 @@ // Error checking only for now. expect("("); skip(); + // Handle cases like i386:x86-64. + if (consume(":")) + skip(); expect(")"); } Index: test/ELF/linkerscript/outputarch.s =================================================================== --- test/ELF/linkerscript/outputarch.s +++ test/ELF/linkerscript/outputarch.s @@ -8,3 +8,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %t1 # RUN: not ld.lld -shared -o %t2 %t1 %t.script # RUN: llvm-readobj %t2 > /dev/null + +# RUN: echo "OUTPUT_ARCH(i386:x86-64)" > %t.script +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %t1 +# RUN: ld.lld -o %t2 %t1 %t.script +# RUN: llvm-readobj %t2 > /dev/null