summary refs log tree commit diff stats
path: root/gitlab/issues_text/target_arm/host_missing/accel_missing/729
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/issues_text/target_arm/host_missing/accel_missing/729')
-rw-r--r--gitlab/issues_text/target_arm/host_missing/accel_missing/72934
1 files changed, 34 insertions, 0 deletions
diff --git a/gitlab/issues_text/target_arm/host_missing/accel_missing/729 b/gitlab/issues_text/target_arm/host_missing/accel_missing/729
new file mode 100644
index 000000000..bf2aac172
--- /dev/null
+++ b/gitlab/issues_text/target_arm/host_missing/accel_missing/729
@@ -0,0 +1,34 @@
+Environment variables are not passed with user-space semihosting
+Description of problem:
+Environment variables are not passed to the emulated process, either inherited (as I might expect it to work in user-space?) or by specifying the values through the QEMU command-line. Note that setting the environment variable from within the app before calling `getenv` does work, so it isn't just a case of some system no-ops for the platform.
+Steps to reproduce:
+1. Compile the following program with [ARM embedded toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads):
+```cpp
+#include <iostream>
+#include <cstdlib>
+
+int main(int argc, char* argv[]) {
+	char* env = std::getenv("TEST");
+	if (env)
+		std::cout << "Env TEST: " << env << "\n";
+	else
+		std::cout << "Env TEST not set.\n";
+	return 0;
+}
+```
+
+```
+$ $CXX --version
+arm-none-eabi-g++ (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)
+Copyright (C) 2020 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+$ $CXX main.cpp --specs=rdimon.specs -mcpu=cortex-m7
+```
+
+2. Run in user-space (semihosted):
+```
+$ qemu-arm -cpu cortex-m7 -E TEST=val123 ./a.out 
+Env TEST not set.
+```