Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@krono
Copy link
Contributor

@krono krono commented Oct 25, 2024

On ppc64le deb machines, when not cross compiling, uname -m reports ppc64le, which is typically right. However, the "Debian machine triplet" that is necessary to build correctly uses powerpc64le for whatever reason. The cross compile path knows this and is explicit about that.

To alleviate that, use dpkg-architecture to discover the HOST CPU type, which is what forms the machine triplet. The conditional check for dpkg-architecture should be safe and reports the right values for x86 and arm, too; falls back to uname -m anyways.

On ppc64le deb machines, when _not_ cross compiling, `uname -m` reports
`ppc64le`, which is typically right. However, the "Debian machine
triplet" that is necessary to build correctly uses `powerpc64le` for
whatever reason. The cross compile path knows this and is explicit about
that.

To alleviate that, use `dpkg-architecture` to discover the HOST _CPU_
type, which is what forms the machine triplet. The conditional check for
`dpkg-architecture` should be safe and reports the right values for
x86 and arm, too; falls back to `uname -m` anyways.
@3XX0
Copy link
Member

3XX0 commented Oct 25, 2024

Right... this is messy.
Correct me if I'm wrong but we want the GNU triplet here, not the Debian one. Debian is ppc64el, GNU is powerpc64le
I think we tried to account for it judging by this but this might not even be correct w.r.t el/le.

Could we make this a little more generic?
IIRC dpkg-architecture relies on $CC -dumpmachine, just wondering if we could just do that

@krono
Copy link
Contributor Author

krono commented Oct 25, 2024

It's debuild that invokes some dh_ stuff, which is unhappy with ppc64le-gnu-linux, because it wants powerpc64le-gnu-linux.

but -dumpmachine sounds plausible…

@krono
Copy link
Contributor Author

krono commented Dec 2, 2024

I switchted the approach to dumpmachine, but deb-specific.

@3XX0
Copy link
Member

3XX0 commented Dec 4, 2024

LGTM, feel free to sign off the commit so I can merge it

seems more apt

Signed-off-by: Tobias Pape <[email protected]>
@krono
Copy link
Contributor Author

krono commented Dec 11, 2024

Hope this was the righ swithc :D

@3XX0 3XX0 merged commit 1cebc0c into NVIDIA:master Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants