Closed ac000 closed 1 month ago
Fix commit message typo
$ git range-diff 347016a8...9c5d6036
1: 347016a8 ! 1: 9c5d6036 auto, perl: Fix building the Perl language module with clang
@@ Commit message
CC build/src/perl/nxt_perl_psgi-perl.o
clang: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]
- There ddoesn't seem to be an easy workaround like -Qunused-arguments for
+ There doesn't seem to be an easy workaround like -Qunused-arguments for
this.
While we could work around it in some way, I'm not sure it's worth the
Hi @hongzhidao
Just to check if you have any issues or questions about this patch?
Just to re-cap, this basically re-enables the building of the perl language module with clang to how it was before commit https://github.com/nginx/unit/commit/c1e3f02f99a3cab181c36d1f55c552e2bcfba370
Fixing this is a prerequisite of merging https://github.com/nginx/unit/pull/1223
Just to check if you have any issues or questions about this patch?
Not at all, feel free to ship it.
Great, thanks!
Rebased with master...
When we added -fno-strict-overflow to the CFLAGS back in c1e3f02f9 ("Compile with -fno-strict-overflow") we inadvertently broke building the Perl language module with clang, e.g
This is due to for example on Apline
Where on clang the -fwrapv causes the -fno-strict-overflow to be discarded resulting in the above error.
We can get around that by simply appending -Qunused-arguments to the Perl CFLAGS.
This fixes things for some systems, as there is actually another issue with building this with clang on Fedora (and probably Red Hat) in that there the Perl ccflags & ldopts have been heavily modified and uses flags simply not only not in clang (which we can work around as above) but also incompatible flags, e.g
There ddoesn't seem to be an easy workaround like -Qunused-arguments for this.
While we could work around it in some way, I'm not sure it's worth the effort right now. On Red Hat & Fedora GCC is the system compiler.
This could be revisited if we find people trying to build this on Red Hat/Fedora with clang...
For comparison this is the Alpine Perl ccflags & ldops
Fedora