We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d448ab0 commit c6bcea9Copy full SHA for c6bcea9
src/test/run-make-fulldeps/glibc-staticlib-args/Makefile
@@ -0,0 +1,12 @@
1
+# only-gnu
2
+# only-linux
3
+
4
+-include ../tools.mk
5
6
+# This ensures that std::env::args works in a library called from C on glibc Linux.
7
8
+all:
9
+ $(RUSTC) --crate-type=staticlib library.rs
10
+ $(CC) program.c $(call STATICLIB,library) $(call OUT_EXE,program) \
11
+ $(EXTRACFLAGS) $(EXTRACXXFLAGS)
12
+ $(call RUN,program)
src/test/run-make-fulldeps/glibc-staticlib-args/library.rs
@@ -0,0 +1,4 @@
+#[no_mangle]
+pub extern fn args_check() {
+ assert_ne!(std::env::args_os().count(), 0);
+}
src/test/run-make-fulldeps/glibc-staticlib-args/program.c
@@ -0,0 +1,7 @@
+// ignore-license
+void args_check();
+int main() {
+ args_check();
+ return 0;
0 commit comments