RFR: 8368102: Don't store macros in spec.gmk

Erik Joelsson erikj at openjdk.org
Mon Sep 22 13:15:45 UTC 2025


On Fri, 19 Sep 2025 16:43:50 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

> We currently have three macros (as in "functions", not just simple strings) that are assigned in spec.gmk. This is in contrast with the rest of the values assigned in spec.gmk, and it is surprising and is forcing an odd syntax. Furthermore, these macros are named as constants, and not as we normally name functions/macros.
> 
> We should move them to normal .gmk code, and rename them.
> 
> The three macros are `SET_SHARED_LIBRARY_ORIGIN`, `SET_EXECUTABLE_ORIGIN` and `SET_SHARED_LIBRARY_NAME`.

make/common/native/Link.gmk line 66:

> 64:     SetSharedLibraryName = \
> 65:       -Wl,-soname=$1
> 66:   endif

Indentation looks off here.
Suggestion:

ifeq ($(call isCompiler, gcc), true)
  SetSharedLibraryName = \
      -Wl,-soname=$1
else ifeq ($(call isCompiler, clang), true)
  ifeq ($(call isTargetOs, macosx), true)
    SetSharedLibraryName = \
        -Wl,-install_name, at rpath/$1
  else ifeq ($(call isTargetOs, aix), true)
    SetSharedLibraryName =
  else
    # Default works for linux, might work on other platforms as well.
    SetSharedLibraryName = \
        -Wl,-soname=$1
  endif

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27394#discussion_r2368327647


More information about the build-dev mailing list