You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Tim Armstrong (Code Review)" <ge...@cloudera.org> on 2016/04/05 23:49:19 UTC

[Toolchain-CR] Fix LLVM linker bug

Hello Casey Ching,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/2656

to look at the new patch set (#3).

Change subject: Fix LLVM linker bug
......................................................................

Fix LLVM linker bug

The LLVM linker has a bug when linking together modules where the
destination module has two or more structurally identical struct types
and the source module also has these same struct types. The bug is that
all of the struct types in the source get mapped to an arbitrary struct
type in the destination. This can cause verification failures when
pointer types in call instructions don't match the argument types. E.g. in
Impala, TinyIntVal and BooleanVal get mixed up.

The LLVM linker has logic to match types by name when linking, but it did
not work correctly because of a bug in the hasType() method that incorrectly
reports that struct types were not present in the destination module: it
looks up a hash table that only contains the first structurally
identical type.

The fix is to maintain a hash table with all struct types in the
destination module and check that instead of the table with structurally
istinct types. The fix passes the LLVM test suite.

Change-Id: I8aef7f79c8d905b267f5acc3392384b1b333e7d3
---
M buildall.sh
M source/llvm/build-source-tarball.sh
A source/llvm/llvm-3.8.0-patches/0001-llvm-link-struct-types.patch
3 files changed, 151 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Toolchain refs/changes/56/2656/3
-- 
To view, visit http://gerrit.cloudera.org:8080/2656
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8aef7f79c8d905b267f5acc3392384b1b333e7d3
Gerrit-PatchSet: 3
Gerrit-Project: Toolchain
Gerrit-Branch: master
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Casey Ching <ca...@cloudera.com>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Michael Ho <kw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>