Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate symbol __clzsi2 #286

Merged
merged 2 commits into from
May 2, 2019
Merged
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
9 changes: 9 additions & 0 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ else
$run --release
$run --features c
$run --features c --release
cargo build --target $1
cargo build --target $1 --release
cargo build --target $1 --features c
cargo build --target $1 --release --features c
fi

PREFIX=$(echo $1 | sed -e 's/unknown-//')-
Expand All @@ -68,6 +72,10 @@ fi
# Look out for duplicated symbols when we include the compiler-rt (C) implementation
for rlib in $(echo $path); do
set +x
echo "================================================================"
echo checking $rlib for duplicate symbols
echo "================================================================"

stdout=$($PREFIX$NM -g --defined-only $rlib 2>&1)

# NOTE On i586, It's normal that the get_pc_thunk symbol appears several
Expand All @@ -86,6 +94,7 @@ for rlib in $(echo $path); do
if test $? = 0; then
exit 1
fi

set -ex
done

Expand Down
1 change: 1 addition & 0 deletions src/float/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ intrinsics! {
#[use_c_shim_if(any(
all(target_arch = "x86", not(target_env = "msvc")),
all(target_arch = "x86_64", not(windows)),
all(target_arch = "x86_64", target_env = "msvc"),
))]
#[arm_aeabi_alias = __aeabi_l2f]
pub extern "C" fn __floatdisf(i: i64) -> f32 {
Expand Down
3 changes: 2 additions & 1 deletion src/int/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ impl_wide_int!(u32, u64, 32);
impl_wide_int!(u64, u128, 64);

intrinsics! {
#[use_c_shim_if(/* always if C compilation is enabled */)]
#[cfg(any(
target_pointer_width = "16",
target_pointer_width = "32",
Expand All @@ -310,7 +311,7 @@ intrinsics! {
pub extern "C" fn __clzsi2(x: usize) -> usize {
// TODO: const this? Would require const-if
// Note(Lokathor): the `intrinsics!` macro can't process mut inputs
let mut x = x;
let mut x = x;
let mut y: usize;
let mut n: usize = {
#[cfg(target_pointer_width = "64")]
Expand Down