This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][PATCH] PR gold/19119: Gold accepts bogus target emulation


On Thu, Oct 15, 2015 at 8:57 AM, Cary Coutant <ccoutant@gmail.com> wrote:
>>         PR gold/19119
>>         * options.h (General_options): Remove "obsolete" from -m.
>
> I'm a little reluctant to remove "obsolete" from the description --
> maybe "deprecated" instead?

In llvm gold plugin tests, there are

test/tools/gold/PowerPC/mtriple.ll:; RUN: %gold -plugin
%llvmshlibdir/LLVMgold.so -m elf32ppc \
test/tools/gold/X86/bcsection.ll:; RUN: %gold -r -o %T/bcsection.o -m
elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so %T/bcsection.bco
test/tools/gold/X86/emit-llvm.ll:; RUN:     -m elf_x86_64
--plugin-opt=save-temps \
test/tools/gold/X86/emit-llvm.ll:; RUN:     -m elf_x86_64
--plugin-opt=disable-output \
test/tools/gold/X86/parallel.ll:; RUN: env
LD_PRELOAD=%llvmshlibdir/LLVMgold.so %gold -plugin
%llvmshlibdir/LLVMgold.so -u foo -u bar -plugin-opt jobs=2 -plugin-opt
save-temps -m elf_x86_64 -o %t %t.bc
test/tools/gold/X86/pr19901.ll:; RUN:     -shared -m elf_x86_64 -o
%t.so %t2.o %t.o
test/tools/gold/X86/remarks.ll:; RUN: %gold -m elf_x86_64 -plugin
%llvmshlibdir/LLVMgold.so \
test/tools/gold/X86/remarks.ll:; RUN: %gold -m elf_x86_64 -plugin
%llvmshlibdir/LLVMgold.so \
test/tools/gold/X86/slp-vectorize.ll:; RUN: %gold -m elf_x86_64
-plugin %llvmshlibdir/LLVMgold.so \
test/tools/gold/X86/vectorize.ll:; RUN: %gold -m elf_x86_64 -plugin
%llvmshlibdir/LLVMgold.so \

On Linux/x86-64, if I remove  -m elf32ppc from
test/tools/gold/PowerPC/mtriple.ll, I get

[hjl@gnu-6 bin]$ ./llvm-lit  --verbose
/export/gnu/import/git/llvm/test/tools/gold/PowerPC/mtriple.ll
-- Testing: 1 tests, 1 threads --
FAIL: LLVM :: tools/gold/PowerPC/mtriple.ll (1 of 1)
******************** TEST 'LLVM :: tools/gold/PowerPC/mtriple.ll'
FAILED ********************
Script:
--
llvm-as /export/ssd/git/llvm/test/tools/gold/PowerPC/mtriple.ll -o
/export/build/gnu/llvm-clang/build-x86_64-linux/test/tools/gold/PowerPC/Output/mtriple.ll.tmp.o
/export/build/gnu/binutils-gold/release/usr/local/bin/ld.gold -plugin
/export/build/gnu/llvm-clang/build-x86_64-linux/./lib/LLVMgold.so
-plugin-opt=mtriple=powerpc-linux-gnu
-plugin-opt=obj-path=/export/build/gnu/llvm-clang/build-x86_64-linux/test/tools/gold/PowerPC/Output/mtriple.ll.tmp3.o
    -shared /export/build/gnu/llvm-clang/build-x86_64-linux/test/tools/gold/PowerPC/Output/mtriple.ll.tmp.o
-o /export/build/gnu/llvm-clang/build-x86_64-linux/test/tools/gold/PowerPC/Output/mtriple.ll.tmp2
llvm-readobj --file-headers
/export/build/gnu/llvm-clang/build-x86_64-linux/test/tools/gold/PowerPC/Output/mtriple.ll.tmp2
| FileCheck  --check-prefix=DSO
/export/ssd/git/llvm/test/tools/gold/PowerPC/mtriple.ll
llvm-readobj --file-headers
/export/build/gnu/llvm-clang/build-x86_64-linux/test/tools/gold/PowerPC/Output/mtriple.ll.tmp3.o
| FileCheck --check-prefix=REL
/export/ssd/git/llvm/test/tools/gold/PowerPC/mtriple.ll
--
Exit Code: 1

Command Output (stderr):
--
/export/build/gnu/binutils-gold/release/usr/local/bin/ld.gold: error:
/export/build/gnu/llvm-clang/build-x86_64-linux/test/tools/gold/PowerPC/Output/mtriple.ll.tmp3.o:
incompatible target

--

********************
Testing Time: 0.02s
********************
Failing Tests (1):
    LLVM :: tools/gold/PowerPC/mtriple.ll

  Unexpected Failures: 1
[hjl@gnu-6 bin]$

It shows that -m elf32ppc is required.  Saying it is obsolete or deprecated
isn't correct.

>>         * parameters.cc (set_parameters_target): Check if input target
>>         is compatible with output emulation set by "-m emulation".
>
> This is OK. Thanks!
>

Is my original patch OK?

Thanks.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]