• [gentoo-dev] [PATCH] toolchain-funcs.eclass: Add functions to get point

    From James Le Cuirot@21:1/5 to All on Mon Nov 6 23:30:01 2023
    tc-get-ptr-size for CHOST and tc-get-build-ptr-size for CBUILD.

    Closes: https://bugs.gentoo.org/328401
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/toolchain-funcs.eclass | 14 ++++++++++++++
    1 file changed, 14 insertions(+)

    diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 8fef764ad597..5da93063866b 100644
    --- a/eclass/toolchain-funcs.eclass
    +++ b/eclass/toolchain-funcs.eclass
    @@ -1216,4 +1216,18 @@ tc-get-c-rtlib() {
    return 0
    }

    +# @FUNCTION: tc-get-ptr-size
    +# @RETURN: Size of a pointer in bytes for CHOST (e.g. 4 or 8). +tc-get-ptr-size() {
    + $(tc-getCPP) -P - <<< __SIZEOF_POINTER__ ||
    + die "Could not determine CHOST pointer size"
    +}
    +
    +# @FUNCTION: tc-get-build-ptr-size
    +# @RETURN: Size of a pointer in bytes for CBUILD (e.g. 4 or 8). +tc-get-build-ptr-size() {
    + $(tc-getBUILD_CPP) -P - <<< __SIZEOF_POINTER__ ||
    + die "Could not determine CBUILD pointer size"
    +}
    +
    fi
    --
    2.41.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to James Le Cuirot on Wed Nov 8 07:50:01 2023
    James Le Cuirot <chewi@gentoo.org> writes:

    tc-get-ptr-size for CHOST and tc-get-build-ptr-size for CBUILD.

    Closes: https://bugs.gentoo.org/328401
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---

    lgtm

    eclass/toolchain-funcs.eclass | 14 ++++++++++++++
    1 file changed, 14 insertions(+)

    diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 8fef764ad597..5da93063866b 100644
    --- a/eclass/toolchain-funcs.eclass
    +++ b/eclass/toolchain-funcs.eclass
    @@ -1216,4 +1216,18 @@ tc-get-c-rtlib() {
    return 0
    }

    +# @FUNCTION: tc-get-ptr-size
    +# @RETURN: Size of a pointer in bytes for CHOST (e.g. 4 or 8). +tc-get-ptr-size() {
    + $(tc-getCPP) -P - <<< __SIZEOF_POINTER__ ||
    + die "Could not determine CHOST pointer size"
    +}
    +
    +# @FUNCTION: tc-get-build-ptr-size
    +# @RETURN: Size of a pointer in bytes for CBUILD (e.g. 4 or 8). +tc-get-build-ptr-size() {
    + $(tc-getBUILD_CPP) -P - <<< __SIZEOF_POINTER__ ||
    + die "Could not determine CBUILD pointer size"
    +}
    +
    fi

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)