Page MenuHomeFreeBSD

zstd: ifdef out visibility of floats in kernel for gcc
AbandonedPublic

Authored by rlibby on Dec 13 2018, 7:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 11:35 PM
Unknown Object (File)
Sep 17 2024, 5:44 PM
Unknown Object (File)
Sep 12 2024, 12:22 AM
Unknown Object (File)
Sep 8 2024, 10:08 PM
Unknown Object (File)
Sep 8 2024, 8:57 AM
Unknown Object (File)
Sep 3 2024, 12:17 AM
Unknown Object (File)
Aug 31 2024, 7:15 PM
Unknown Object (File)
Aug 17 2024, 7:43 AM
Subscribers

Details

Reviewers
cem
Summary

Minimal work-around for upstream issue:
https://github.com/facebook/zstd/issues/1386

Test Plan

make CROSS_TOOLCHAIN=amd64-gcc TARGET=amd64 buildkernel

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 21533
Build 20841: arc lint + arc unit

Event Timeline

@cem is direct commit to sys/contrib/zstd okay for this?

cem added a subscriber: jhb.

I'm honestly not sure if direct commits to vendored code are ok. IMO, go for it, but you might consult with someone more senior (@jhb ?).

The functional change looks fine to me — I'm assuming you've compile-tested this with GCC, since that was the motivation for the change (and the other changes you've proposed on $WORK Slack).

sys/contrib/zstd/lib/compress/zstd_compress_internal.h
692

One nitpicky suggestion is that usually #if conditions are not parenthesized and also the usual style about spaces between operands and operator applies. (If it's the prevailing style in the file, ignore this nitpick.)

This revision is now accepted and ready to land.Dec 13 2018, 5:42 PM
cem requested changes to this revision.Dec 13 2018, 5:45 PM

Sorry, one other thing occurred to me.

sys/contrib/zstd/lib/compress/zstd_compress_internal.h
692

Actually, one other request for you. Please make these conditions:

#if DEBUGLEVEL >= 2 && defined(_KERNEL)

(Or whatever equivalent construction is stylistically appropriate for the file.)

We don't want to break debug in userspace, where floats more are appropriate.

This revision now requires changes to proceed.Dec 13 2018, 5:45 PM
sys/contrib/zstd/lib/compress/zstd_compress_internal.h
692

Sure, I can make those changes. What I did here was copy the ifdef guard around DEBUGLOG in sys/contrib/zstd/lib/common/debug.h, i.e. this is the same condition that guards definition of DEBUGLOG in the first place. So I don't think it will break anything. But being more restrictive for the kernel seems harmless. Incidentally, DEBUGLOG would not work in the kernel as coded anyway (fprintf(stderr, ...)).

cem added inline comments.
sys/contrib/zstd/lib/compress/zstd_compress_internal.h
692

Oh, in that case, please ignore my _KERNEL suggestion. When you say copy the ifdef guard from debug.h, you mean the style came from upstream as well? If so, please ignore my style suggestions too.

This revision is now accepted and ready to land.Dec 13 2018, 5:59 PM
sys/contrib/zstd/lib/compress/zstd_compress_internal.h
692

Yes, that's right, verbatim. Okay, thanks!

@cem got this pushed upstream [1] and we pulled it back down with v1.3.8 in r342598.

[1] https://github.com/facebook/zstd/issues/1386