[all-commits] [llvm/llvm-project] 1a92cc: [libc] Implement 'getenv' on the GPU target (#102376)

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Aug 8 04:46:04 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a92cc5a0ad108c515b1c383645ff70069c12077
      https://github.com/llvm/llvm-project/commit/1a92cc5a0ad108c515b1c383645ff70069c12077
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-08-08 (Thu, 08 Aug 2024)

  Changed paths:
    M libc/config/CMakeLists.txt
    A libc/config/app.h
    A libc/config/gpu/app.h
    M libc/config/gpu/entrypoints.txt
    R libc/config/linux/CMakeLists.txt
    M libc/src/__support/threads/linux/CMakeLists.txt
    M libc/src/__support/threads/linux/thread.cpp
    M libc/src/stdlib/CMakeLists.txt
    M libc/src/stdlib/getenv.cpp
    M libc/src/sys/auxv/linux/CMakeLists.txt
    M libc/src/sys/auxv/linux/getauxval.cpp
    M libc/startup/gpu/CMakeLists.txt
    M libc/startup/gpu/amdgpu/CMakeLists.txt
    M libc/startup/gpu/amdgpu/start.cpp
    M libc/startup/gpu/nvptx/CMakeLists.txt
    M libc/startup/gpu/nvptx/start.cpp
    M libc/startup/linux/CMakeLists.txt
    M libc/startup/linux/aarch64/CMakeLists.txt
    M libc/startup/linux/do_start.h
    M libc/startup/linux/riscv/CMakeLists.txt
    M libc/startup/linux/x86_64/CMakeLists.txt
    M libc/test/integration/src/stdlib/CMakeLists.txt

  Log Message:
  -----------
  [libc] Implement 'getenv' on the GPU target (#102376)

Summary:
This patch implements 'getenv'. I was torn on how to implement this,
since realistically we only have access to this environment pointer in
the "loader" interface. An alternative would be to use an RPC call every
time, but I think that's overkill for what this will be used for. A
better solution is just to emit a common `DataEnvironment` that contains
all of the host visible resources to initialize. Right now this is the
`env_ptr`, `clock_freq`, and `rpc_client`.

I did this by making the `app.h` interface that Linux uses more general,
could possibly move that into a separate patch, but I figured it's
easier to see with the usage.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list