-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #57116 - kennytm:revert-56944, r=alexcrichton
Revert #56944. This should fix #57111, since #56944 is the only PR involving LLVM. #57111 is caused by both the rustc and rust-std tarballs providing libLLVM. r? @alexcrichton
- Loading branch information
Showing
11 changed files
with
240 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-include ../tools.mk | ||
|
||
ifeq ($(UNAME),Darwin) | ||
PLUGIN_FLAGS := -C link-args=-Wl,-undefined,dynamic_lookup | ||
endif | ||
|
||
ifeq ($(findstring stage1,$(RUST_BUILD_STAGE)),stage1) | ||
# ignore stage1 | ||
all: | ||
|
||
else | ||
# Windows doesn't correctly handle include statements with escaping paths, | ||
# so this test will not get run on Windows. | ||
ifdef IS_WINDOWS | ||
all: | ||
else | ||
all: $(call NATIVE_STATICLIB,llvm-function-pass) $(call NATIVE_STATICLIB,llvm-module-pass) | ||
$(RUSTC) plugin.rs -C prefer-dynamic $(PLUGIN_FLAGS) | ||
$(RUSTC) main.rs | ||
|
||
$(TMPDIR)/libllvm-function-pass.o: | ||
$(CXX) $(CFLAGS) $(LLVM_CXXFLAGS) -c llvm-function-pass.so.cc -o $(TMPDIR)/libllvm-function-pass.o | ||
|
||
$(TMPDIR)/libllvm-module-pass.o: | ||
$(CXX) $(CFLAGS) $(LLVM_CXXFLAGS) -c llvm-module-pass.so.cc -o $(TMPDIR)/libllvm-module-pass.o | ||
endif | ||
|
||
endif |
56 changes: 56 additions & 0 deletions
56
src/test/run-make-fulldeps/llvm-pass/llvm-function-pass.so.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
#include "llvm/Pass.h" | ||
#include "llvm/IR/Function.h" | ||
|
||
using namespace llvm; | ||
|
||
namespace { | ||
|
||
class TestLLVMPass : public FunctionPass { | ||
|
||
public: | ||
|
||
static char ID; | ||
TestLLVMPass() : FunctionPass(ID) { } | ||
|
||
bool runOnFunction(Function &F) override; | ||
|
||
StringRef getPassName() const override { | ||
return "Some LLVM pass"; | ||
} | ||
|
||
}; | ||
|
||
} | ||
|
||
bool TestLLVMPass::runOnFunction(Function &F) { | ||
// A couple examples of operations that previously caused segmentation faults | ||
// https://github.com/rust-lang/rust/issues/31067 | ||
|
||
for (auto N = F.begin(); N != F.end(); ++N) { | ||
/* code */ | ||
} | ||
|
||
LLVMContext &C = F.getContext(); | ||
IntegerType *Int8Ty = IntegerType::getInt8Ty(C); | ||
PointerType::get(Int8Ty, 0); | ||
return true; | ||
} | ||
|
||
char TestLLVMPass::ID = 0; | ||
|
||
static RegisterPass<TestLLVMPass> RegisterAFLPass( | ||
"some-llvm-function-pass", "Some LLVM pass"); |
55 changes: 55 additions & 0 deletions
55
src/test/run-make-fulldeps/llvm-pass/llvm-module-pass.so.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
#include "llvm/IR/Module.h" | ||
|
||
using namespace llvm; | ||
|
||
namespace { | ||
|
||
class TestLLVMPass : public ModulePass { | ||
|
||
public: | ||
|
||
static char ID; | ||
TestLLVMPass() : ModulePass(ID) { } | ||
|
||
bool runOnModule(Module &M) override; | ||
|
||
StringRef getPassName() const override { | ||
return "Some LLVM pass"; | ||
} | ||
|
||
}; | ||
|
||
} | ||
|
||
bool TestLLVMPass::runOnModule(Module &M) { | ||
// A couple examples of operations that previously caused segmentation faults | ||
// https://github.com/rust-lang/rust/issues/31067 | ||
|
||
for (auto F = M.begin(); F != M.end(); ++F) { | ||
/* code */ | ||
} | ||
|
||
LLVMContext &C = M.getContext(); | ||
IntegerType *Int8Ty = IntegerType::getInt8Ty(C); | ||
PointerType::get(Int8Ty, 0); | ||
return true; | ||
} | ||
|
||
char TestLLVMPass::ID = 0; | ||
|
||
static RegisterPass<TestLLVMPass> RegisterAFLPass( | ||
"some-llvm-module-pass", "Some LLVM pass"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![feature(plugin)] | ||
#![plugin(some_plugin)] | ||
|
||
fn main() {} |
Oops, something went wrong.