Page MenuHomeFreeBSD

libcxx: use __SIZEOF_LONG__ == 8 instead of __LP64__
ClosedPublic

Authored by kib on Jan 24 2023, 10:06 AM.
Tags
None
Referenced Files
F84182248: D38178.id115535.diff
Mon, May 20, 12:30 PM
F84182241: D38178.id115705.diff
Mon, May 20, 12:30 PM
F84182233: D38178.id.diff
Mon, May 20, 12:30 PM
F84170196: D38178.diff
Mon, May 20, 8:32 AM
Unknown Object (File)
Tue, May 14, 7:45 PM
Unknown Object (File)
Tue, May 14, 6:57 AM
Unknown Object (File)
Tue, May 14, 6:57 AM
Unknown Object (File)
Tue, May 14, 6:57 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jan 24 2023, 10:06 AM

We should perhaps put a comment about this (__SIZEOF_LONG__ == 8) idiom in arch.7. @arichardson?

This revision is now accepted and ready to land.Jan 24 2023, 3:10 PM

We should perhaps put a comment about this (__SIZEOF_LONG__ == 8) idiom in arch.7. @arichardson?

I think that would be good in general.

I also think that the commit message comment of

Only 64bit architectures can be supported this way, because libcxx
defines __cxx_contention_t to be int64_t for FreeBSD.

or similar, perhaps terser, should be included in this section of code. I puzzled over why 64-bit was special here and while I could find it in the commit logs, it struck me as being important enough to include:

/* libcxx defines __cxx_contention_t as int64_t, so this only works on 64-bit pointers */

maybe?

This revision now requires review to proceed.Jan 24 2023, 3:38 PM
emaste added inline comments.
contrib/llvm-project/libcxx/src/atomic.cpp
84

sp: synonyms

This revision is now accepted and ready to land.Jan 24 2023, 3:51 PM
kib marked an inline comment as done.Jan 24 2023, 5:10 PM

This still isn't quite right if you're MFC'ing it; MIPS is "special" in-tree and uses int32_t, both for 32-bit and 64-bit... see D26774 which broke ABI on both to make it 32-bit and deviated from upstream's ABI

This still isn't quite right if you're MFC'ing it; MIPS is "special" in-tree and uses int32_t, both for 32-bit and 64-bit... see D26774 which broke ABI on both to make it 32-bit and deviated from upstream's ABI

But it will work, just causing more spurious wakeups?

Anyway, I can add !defined(__mips__) to the MFC. Are you fine with that?