https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112669

--- Comment #1 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Tracing through 'gcc/gcc.cc': 'build_search_list' -> 'for_each_path', I find:

For '-march=gfx908', we have:

    (gdb) print multilib_dir
    $3 = 0x82e6c0 "gfx908"
    (gdb) print multilib_os_dir
    $4 = 0x82e6c0 "gfx908"

For '-march=gfx906 -march=gfx908', we have:

    (gdb) print multilib_dir
    $3 = 0x0
    (gdb) print multilib_os_dir
    $4 = 0x0

These are:

    /* Subdirectory to use for locating libraries.  Set by
       set_multilib_dir based on the compilation options.  */

    static const char *multilib_dir;

    /* Subdirectory to use for locating libraries in OS conventions.  Set by
       set_multilib_dir based on the compilation options.  */

    static const char *multilib_os_dir;

Indeed, simpler:

    $ build-gcc-offload-amdgcn-amdhsa/gcc/xgcc -print-multi-directory
-march=gfx908
    gfx908
    $ build-gcc-offload-amdgcn-amdhsa/gcc/xgcc -print-multi-directory
-march=gfx906 -march=gfx908
    .

Instead of '.' (default), the latter should also print 'gfx908'.

I'll look into 'set_multilib_dir' etc.

Reply via email to