GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
gcn

Pass linker search paths to amdgcn-amdhsa linker.

Enables passing `-L<dir>` linker search paths to the amdgcn-amdhsa linker via mkoffload.

The mkoffload tool for GCN targets now correctly passes -L<dir> arguments to the amdgcn-amdhsa linker. This is crucial for scenarios where libraries are located in non-standard directories, especially the current directory (.), which is not included in the linker’s default search path. Users can now specify these paths using --offload-options='-L.'.

In Details

This commit enhances mkoffload's integration with the amdgcn-amdhsa toolchain by ensuring that -L<dir> arguments provided via --offload-options are passed through to the final device linker (collect2). This addresses a gap where linker search paths, particularly the current directory, were not being conveyed, preventing correct linking of offloaded code requiring external libraries.

For Context
gcn
Graphics Core Next, AMD's GPU architecture.
mkoffload
A GCC tool that manages offloading compilation for targets like GCN, preparing code for execution on accelerators.
amdgcn-amdhsa
The AMD GPU compiler toolchain for GCN targets, including the compiler, assembler, and linker, targeting the HSA (Heterogeneous System Architecture) runtime.
linker search path
Directories that the linker searches for shared libraries (e.g., .so files) when resolving symbol dependencies.
Filed Under: gcnlinkeroffloading