Skip to content

Fix Compiling on FreeBSD + gcc #11069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

erikarn
Copy link

@erikarn erikarn commented Oct 15, 2020

Fix compile issues on FreeBSD/amd64 with gcc

Motivation and Context

This fixes issue #11068 .

Description

  • remove illumnos specific printf formatting
  • fix some pointers-are-not-uint64 assumptions

How Has This Been Tested?

  • compiled on freebsd amd64 + gcc
  • compile time testing for now
  • it shouldn't affect anything else

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

@erikarn erikarn changed the title Openzfs 11068 Fix Compiling on FreeBSD + gcc Oct 15, 2020
@erikarn
Copy link
Author

erikarn commented Oct 15, 2020

There's something up with the current form of the patch on llvm, because amusingly it implements cmn_err as a format argument.

I'll update the pull request tonight.

@ghost ghost added the Status: Work in Progress Not yet ready for general review label Oct 15, 2020
@ghost ghost self-requested a review October 15, 2020 21:39
@codecov
Copy link

codecov bot commented Oct 16, 2020

Codecov Report

Merging #11069 (e4cce39) into master (52e585a) will increase coverage by 0.25%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11069      +/-   ##
==========================================
+ Coverage   79.46%   79.72%   +0.25%     
==========================================
  Files         398      397       -1     
  Lines      125766   125754      -12     
==========================================
+ Hits        99945   100257     +312     
+ Misses      25821    25497     -324     
Flag Coverage Δ
kernel 80.41% <ø> (+0.06%) ⬆️
user 65.80% <ø> (+1.60%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/zvol_id/zvol_id_main.c 76.31% <0.00%> (-5.27%) ⬇️
module/lua/lmem.c 83.33% <0.00%> (-4.17%) ⬇️
module/zfs/spa_errlog.c 90.83% <0.00%> (-3.82%) ⬇️
module/zfs/zio_compress.c 92.72% <0.00%> (-1.82%) ⬇️
cmd/zed/agents/fmd_api.c 88.61% <0.00%> (-1.78%) ⬇️
cmd/zed/agents/zfs_diagnosis.c 77.84% <0.00%> (-1.17%) ⬇️
lib/libzfs/libzfs_changelist.c 85.18% <0.00%> (-1.12%) ⬇️
module/zfs/zfs_fm.c 86.02% <0.00%> (-1.10%) ⬇️
module/icp/io/aes.c 29.33% <0.00%> (-1.09%) ⬇️
module/zcommon/zfs_uio.c 87.75% <0.00%> (-1.03%) ⬇️
... and 69 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52e585a...38e6b43. Read the comment docs.

@behlendorf
Copy link
Contributor

cc: @mjguzik you may be interested in this.

@erikarn
Copy link
Author

erikarn commented Nov 6, 2020

i'll push a simpler update soon - itturns out that the openzfs codebase is peppered with format check failures that don't get picked up in Linux builds with llvm because llvm just completely ignores printf format flags for the given format attribute.

They trip on freebsd because freebsd's printf target is being checked for format attributes correctly.

So, I'll push the ioctl fixes and then a separate fix that just simply disables all of the format checks on freebsd until we can figure out a plan to fix them for both linux/freebsd.

@mattmacy
Copy link
Contributor

mattmacy commented Nov 9, 2020

@erikarn when do you think you can get that update in?

@erikarn
Copy link
Author

erikarn commented Nov 9, 2020 via email

@behlendorf
Copy link
Contributor

@erikarn that'd be great, thanks.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you rebase this on the latest commits in the master branch it should resolve the FreeBSD CI build failures.

@erikarn
Copy link
Author

erikarn commented Nov 10, 2020 via email

Adrian Chadd added 2 commits November 9, 2020 22:02
This shows up when compiling freebsd-head on amd64 using gcc-6.4.
The lib32 compat build ends up tripping over this assumption.

Signed-off-by: adrian chadd <[email protected]>
This looks like it was once from the illumnos compat code.
FreeBSD doesn't have cmn_err as a compiler format attribute, so
it definitely errors out.

It doesn't show up on LLVM because it doesn't trigger at all.

Add in the format flags but keep them behind #if 0 for now;
there are too many format issues that trigger when one does
format checking in the shared code.

Signed-off-by: adrian chadd <[email protected]>
@erikarn
Copy link
Author

erikarn commented Nov 10, 2020

hi!

I did rebase them but the freebsd failures still occur. Is that because of my diff? It looks like a variety of out of space and crashes happened?

@ghost
Copy link

ghost commented Nov 10, 2020

The compress_003_pos failure on FreeBSD head is a known failure, don't worry about it.

@ghost ghost added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Work in Progress Not yet ready for general review labels Nov 10, 2020
behlendorf pushed a commit that referenced this pull request Nov 10, 2020
This looks like it was once from the illumnos compat code.
FreeBSD doesn't have cmn_err as a compiler format attribute, so
it definitely errors out.

It doesn't show up on LLVM because it doesn't trigger at all.

Add in the format flags but keep them behind #if 0 for now;
there are too many format issues that trigger when one does
format checking in the shared code.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes #11068
Closes #11069
behlendorf pushed a commit that referenced this pull request Nov 11, 2020
This shows up when compiling freebsd-head on amd64 using gcc-6.4.
The lib32 compat build ends up tripping over this assumption.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes #11068
Closes #11069
behlendorf pushed a commit that referenced this pull request Nov 11, 2020
This looks like it was once from the illumnos compat code.
FreeBSD doesn't have cmn_err as a compiler format attribute, so
it definitely errors out.

It doesn't show up on LLVM because it doesn't trigger at all.

Add in the format flags but keep them behind #if 0 for now;
there are too many format issues that trigger when one does
format checking in the shared code.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes #11068
Closes #11069
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
This shows up when compiling freebsd-head on amd64 using gcc-6.4.
The lib32 compat build ends up tripping over this assumption.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes openzfs#11068
Closes openzfs#11069
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
This looks like it was once from the illumnos compat code.
FreeBSD doesn't have cmn_err as a compiler format attribute, so
it definitely errors out.

It doesn't show up on LLVM because it doesn't trigger at all.

Add in the format flags but keep them behind #if 0 for now;
there are too many format issues that trigger when one does
format checking in the shared code.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes openzfs#11068
Closes openzfs#11069
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
This shows up when compiling freebsd-head on amd64 using gcc-6.4.
The lib32 compat build ends up tripping over this assumption.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes openzfs#11068
Closes openzfs#11069
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
This looks like it was once from the illumnos compat code.
FreeBSD doesn't have cmn_err as a compiler format attribute, so
it definitely errors out.

It doesn't show up on LLVM because it doesn't trigger at all.

Add in the format flags but keep them behind #if 0 for now;
there are too many format issues that trigger when one does
format checking in the shared code.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: adrian chadd <[email protected]>
Closes openzfs#11068
Closes openzfs#11069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants