Skip to content
This repository was archived by the owner on Feb 9, 2020. It is now read-only.

Switch to ptx-linker #8

Open
wants to merge 2 commits into
base: nvptx
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_codegen_utils/symbol_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ pub fn sanitize(result: &mut String, s: &str) -> bool {

// '.' doesn't occur in types and functions, so reuse it
// for ':' and '-'
'-' | ':' => result.push('_'),
'-' | ':' => result.push('.'),

// These are legal symbols
'a'..='z' | 'A'..='Z' | '0'..='9' | '_' | '.' | '$' => result.push(c),
Expand Down
8 changes: 3 additions & 5 deletions src/librustc_target/spec/nvptx64_nvidia_cuda.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/// Copied from wasm32-unknown-unknown

use super::{LinkerFlavor, Target, TargetOptions, PanicStrategy};
use super::{LinkerFlavor, PanicStrategy, Target, TargetOptions};

pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
cpu: "sm_50".to_string(),
linker: None,
linker: Some("ptx-linker".into()),
dynamic_linking: true,
only_cdylib: true,
executables: false,
Expand All @@ -15,7 +14,7 @@ pub fn target() -> Result<Target, String> {
singlethread: true,
obj_is_bitcode: true,
panic_strategy: PanicStrategy::Abort,
.. Default::default()
..Default::default()
};
Ok(Target {
llvm_target: "nvptx64-nvidia-cuda".to_string(),
Expand All @@ -31,4 +30,3 @@ pub fn target() -> Result<Target, String> {
options: opts,
})
}