Skip to content
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

Added build system check for posix_memalign support. #888

Merged
merged 2 commits into from
Jul 7, 2021

Conversation

nmoinvaz
Copy link
Member

Build system check I suggested in #884. I have added mentioned @concatime as a co-author since I took some of the code from #884 for calling posix_memalign.

@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #888 (68825c3) into develop (b937afd) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head 68825c3 differs from pull request most recent head ba36dfe. Consider uploading reports for the commit ba36dfe to get more accurate results
Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #888   +/-   ##
========================================
  Coverage    78.16%   78.16%           
========================================
  Files           78       78           
  Lines         8354     8350    -4     
  Branches      1362     1359    -3     
========================================
- Hits          6530     6527    -3     
+ Misses        1293     1291    -2     
- Partials       531      532    +1     
Flag Coverage Δ
macos_clang 68.04% <ø> (-0.01%) ⬇️
macos_gcc 66.76% <ø> (+0.03%) ⬆️
ubuntu_clang 74.94% <ø> (+<0.01%) ⬆️
ubuntu_clang_debug 75.23% <ø> (ø)
ubuntu_clang_inflate_allow_invalid_dist 74.69% <ø> (+<0.01%) ⬆️
ubuntu_clang_inflate_strict 74.93% <ø> (+<0.01%) ⬆️
ubuntu_clang_mmap 74.91% <ø> (+<0.01%) ⬆️
ubuntu_clang_msan 74.94% <ø> (+<0.01%) ⬆️
ubuntu_clang_pigz 35.68% <ø> (-0.01%) ⬇️
ubuntu_clang_pigz_no_optim 37.98% <ø> (-0.01%) ⬇️
ubuntu_clang_pigz_no_threads 35.22% <ø> (-0.01%) ⬇️
ubuntu_clang_reduced_mem 75.20% <ø> (-0.05%) ⬇️
ubuntu_gcc 74.48% <ø> (-0.06%) ⬇️
ubuntu_gcc_aarch64 74.62% <ø> (-0.03%) ⬇️
ubuntu_gcc_aarch64_compat_no_opt 73.43% <ø> (-0.02%) ⬇️
ubuntu_gcc_aarch64_no_acle 73.83% <ø> (-0.02%) ⬇️
ubuntu_gcc_aarch64_no_neon 74.17% <ø> (-0.02%) ⬇️
ubuntu_gcc_armhf 74.62% <ø> (-0.03%) ⬇️
ubuntu_gcc_armhf_compat_no_opt 73.40% <ø> (-0.02%) ⬇️
ubuntu_gcc_armhf_no_acle 74.82% <ø> (-0.03%) ⬇️
ubuntu_gcc_armhf_no_neon 75.11% <ø> (-0.03%) ⬇️
ubuntu_gcc_armsf 74.63% <ø> (-0.03%) ⬇️
ubuntu_gcc_armsf_compat_no_opt 73.40% <ø> (-0.02%) ⬇️
ubuntu_gcc_compat_no_opt 74.54% <ø> (-0.03%) ⬇️
ubuntu_gcc_mingw_i686 0.00% <ø> (ø)
ubuntu_gcc_mingw_x86_64 0.00% <ø> (ø)
ubuntu_gcc_no_avx2 74.76% <ø> (-0.01%) ⬇️
ubuntu_gcc_no_pclmulqdq 73.08% <ø> (-0.02%) ⬇️
ubuntu_gcc_no_sse2 74.08% <ø> (-0.01%) ⬇️
ubuntu_gcc_no_sse4 73.34% <ø> (-0.02%) ⬇️
ubuntu_gcc_o3 73.73% <ø> (-0.07%) ⬇️
ubuntu_gcc_osb 77.47% <ø> (ø)
ubuntu_gcc_pigz 36.04% <ø> (+0.05%) ⬆️
ubuntu_gcc_pigz_aarch64 36.13% <ø> (+<0.01%) ⬆️
ubuntu_gcc_ppc 73.22% <ø> (-0.03%) ⬇️
ubuntu_gcc_ppc64 75.81% <ø> (-0.04%) ⬇️
ubuntu_gcc_ppc64le 74.41% <ø> (-0.03%) ⬇️
ubuntu_gcc_s390x 73.61% <ø> (-0.02%) ⬇️
ubuntu_gcc_sparc64 76.23% <ø> (-0.04%) ⬇️
win64_gcc 69.55% <ø> (ø)
win64_gcc_compat_no_opt 73.60% <ø> (ø)

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

Impacted Files Coverage Δ
zutil.c 82.14% <ø> (ø)
zutil_p.h 83.33% <ø> (+16.66%) ⬆️
deflate_medium.c 86.07% <0.00%> (-1.27%) ⬇️
deflate.h 47.82% <0.00%> (ø)
arch/x86/crc_folding.c 99.27% <0.00%> (ø)
gzlib.c 56.73% <0.00%> (+0.09%) ⬆️

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 b937afd...ba36dfe. Read the comment docs.

@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from 3645225 to 3b95121 Compare March 18, 2021 03:54
zutil_p.h Outdated Show resolved Hide resolved
@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from 3b95121 to 092c4ca Compare March 18, 2021 04:00
@lgtm-com
Copy link

lgtm-com bot commented Mar 18, 2021

This pull request introduces 1 alert when merging 092c4ca into b22bc51 - view on LGTM.com

new alerts:

  • 1 for Implicit function declaration

@Dead2
Copy link
Member

Dead2 commented Mar 18, 2021

One of the CI checks errors out with

In file included from /home/runner/work/zlib-ng/zlib-ng/zutil.c:8:
/home/runner/work/zlib-ng/zlib-ng/zutil_p.h: In function ‘zng_alloc’:
/home/runner/work/zlib-ng/zlib-ng/zutil_p.h:25:12: error: implicit declaration of function ‘posix_memalign’ [-Werror=implicit-function-declaration]
   25 |     return posix_memalign(&ptr, 64, size) ? NULL : ptr;
      |            ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/zlib.dir/build.make:329: CMakeFiles/zlib.dir/zutil.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:360: CMakeFiles/zlib.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

@mtl1979
Copy link
Collaborator

mtl1979 commented Mar 18, 2021

@Dead2 posix_memalign prototype is not defined if _POSIX_C_SOURCE is too low (as is the default)

@Dead2
Copy link
Member

Dead2 commented Jun 11, 2021

Needs a rebase

@Dead2 Dead2 added the Rebase needed Please do a 'git rebase develop yourbranch' label Jun 11, 2021
@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from 092c4ca to 8f1c6fc Compare June 12, 2021 03:30
@nmoinvaz
Copy link
Member Author

Rebased.

@nmoinvaz nmoinvaz removed the Rebase needed Please do a 'git rebase develop yourbranch' label Jun 12, 2021
@lgtm-com
Copy link

lgtm-com bot commented Jun 12, 2021

This pull request introduces 1 alert when merging 8f1c6fc into 558192b - view on LGTM.com

new alerts:

  • 1 for Implicit function declaration

@nmoinvaz
Copy link
Member Author

Not sure what include I am missing.

@nmoinvaz nmoinvaz marked this pull request as draft June 12, 2021 04:04
@mtl1979
Copy link
Collaborator

mtl1979 commented Jun 12, 2021

@nmoinvaz _POSIX_C_SOURCE might be defined to too low value.

@nmoinvaz
Copy link
Member Author

@mtl1979 that doesn't appear to be the issue. I tried different values and also printed them out to make sure.

@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch 2 times, most recently from 903b472 to 0c05690 Compare June 25, 2021 21:37
@nmoinvaz
Copy link
Member Author

Merge #1019 first.

@mtl1979
Copy link
Collaborator

mtl1979 commented Jun 25, 2021

diff --git a/zutil.c b/zutil.c
index b38dc45a..602f946d 100644
--- a/zutil.c
+++ b/zutil.c
@@ -4,8 +4,8 @@
  */

 #include "zbuild.h"
-#include "zutil.h"
 #include "zutil_p.h"
+#include "zutil.h"

 z_const char * const PREFIX(z_errmsg)[10] = {
     (z_const char *)"need dictionary",     /* Z_NEED_DICT       2  */

@mtl1979
Copy link
Collaborator

mtl1979 commented Jun 25, 2021

Have to make sure no other file includes the header before defining _POSIX_C_SOURCE. ;)

@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from 0c05690 to 63e55c6 Compare June 25, 2021 22:38
@mtl1979
Copy link
Collaborator

mtl1979 commented Jun 25, 2021

Still failing CI...

@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from 63e55c6 to bbf7d7d Compare June 25, 2021 22:53
@mtl1979
Copy link
Collaborator

mtl1979 commented Jun 25, 2021

Failing left and right...

@nmoinvaz
Copy link
Member Author

Thanks dude I can see the CI for myself.

@mtl1979
Copy link
Collaborator

mtl1979 commented Jun 25, 2021

@nmoinvaz It's spamming other people with notifications...

@nmoinvaz
Copy link
Member Author

There is an unsubscribe button on the right side.

@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from bbf7d7d to 852eaca Compare June 25, 2021 23:46
@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from 852eaca to 536d3e0 Compare June 25, 2021 23:47
@lgtm-com
Copy link

lgtm-com bot commented Jun 25, 2021

This pull request introduces 1 alert when merging 536d3e0 into 564d473 - view on LGTM.com

new alerts:

  • 1 for Implicit function declaration

@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch 2 times, most recently from 68825c3 to 2fe8e93 Compare June 26, 2021 01:08
@nmoinvaz nmoinvaz marked this pull request as ready for review June 26, 2021 01:48
@Dead2 Dead2 added the Rebase needed Please do a 'git rebase develop yourbranch' label Jun 26, 2021
nmoinvaz and others added 2 commits June 26, 2021 08:22
Co-authored-by: concatime <concatime@users.noreply@github.com>
Co-authored-by: Mika Lindqvist <postmaster@raasu.org>
@nmoinvaz nmoinvaz force-pushed the improvements/posix-memalign branch from 2fe8e93 to ba36dfe Compare June 26, 2021 15:22
@nmoinvaz nmoinvaz removed the Rebase needed Please do a 'git rebase develop yourbranch' label Jun 26, 2021
Copy link
Member

@Dead2 Dead2 left a comment

Choose a reason for hiding this comment

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

LGTM

@Dead2 Dead2 merged commit 88d077a into zlib-ng:develop Jul 7, 2021
Dead2 added a commit that referenced this pull request Dec 13, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050
@Dead2 Dead2 mentioned this pull request Dec 13, 2021
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1071
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1071
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1071
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1049 #1071
 - Fix incorrect function declaration warning #1080
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1049 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1049 #1071
 - Fix incorrect function declaration warning #1080
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1049 #1051 #1056 #1063 #1067 #1079
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 24, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1049 #1071
 - Fix incorrect function declaration warning #1080
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1049 #1051 #1056 #1063 #1067 #1079
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants