-
-
Save brendanzab/10937807 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
rustc src/lib.rs -o idris/idrisfs.o --crate-type=lib --emit=obj | |
Undefined symbols for architecture x86_64: | |
"___morestack", referenced from: | |
_sizeof_int in idrisfs.o | |
sizeof_int::__rust_abi in idrisfs.o | |
mem::size_of::h1f2d9faff57bec09oaa::v0.0 in idrisfs.o | |
ld: symbol(s) not found for architecture x86_64 | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
FAILURE: gcc -O2 -fwrapv -fno-strict-overflow -I. ./idrisfs.o -x c /var/folders/_t/g72k9vzd30b5svvyd1nxpwp40000gn/T/idris5178 -L/Users/sven/Library/Haskell/ghc-7.6.3/lib/idris-0.9.12/share/rts -lidris_rts -lgmp -lpthread -I/Users/sven/Library/Haskell/ghc-7.6.3/lib/idris-0.9.12/share/rts -I. -I/Users/sven/Library/Haskell/ghc-7.6.3/lib/idris-0.9.12/share/prelude -I/Users/sven/Library/Haskell/ghc-7.6.3/lib/idris-0.9.12/share/base -o /var/folders/_t/g72k9vzd30b5svvyd1nxpwp40000gn/T/idris5176 | |
/bin/sh: /var/folders/_t/g72k9vzd30b5svvyd1nxpwp40000gn/T/idris5176: No such file or directory |
This file contains hidden or 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
module Main | |
-- %dynamic "./../target/x86_64-apple-darwin/lib/libidrisfs-ba8d5852-0.0.dylib" | |
%include C "idrisfs.h" | |
%link C "idrisfs.o" | |
getSizeInt : IO Int | |
getSizeInt = mkForeign (FFun "sizeof_int" [] FInt) | |
main : IO () | |
main = do | |
x <- getSizeInt | |
putStrLn (show x) | |
This file contains hidden or 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
#![crate_id = "idrisfs"] | |
#![deny(missing_doc)] | |
//! Documentation goes here. | |
/// Returns the number of bytes in an int. | |
#[no_mangle] | |
pub extern "C" fn sizeof_int() -> int { | |
std::mem::size_of::<int>() as int | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment