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)
Mon, Apr 29, 4:03 AM
Unknown Object (File)
Fri, Apr 26, 1:56 AM
Unknown Object (File)
Mar 26 2024, 10:14 PM
Unknown Object (File)
Jan 14 2024, 3:20 AM
Unknown Object (File)
Jan 10 2024, 7:10 PM
Unknown Object (File)
Dec 20 2023, 2:35 AM
Unknown Object (File)
Nov 23 2023, 6:20 PM
Unknown Object (File)
Aug 2 2023, 1:00 PM
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