Bug 231780 - databases/redis-devel: fix build with GCC-based architectures
Summary: databases/redis-devel: fix build with GCC-based architectures
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sergey A. Osokin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-28 12:36 UTC by Piotr Kubaj
Modified: 2018-10-18 22:21 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (osa)


Attachments
patch (360 bytes, patch)
2018-09-28 12:36 UTC, Piotr Kubaj
no flags Details | Diff
Fixes build on mips, and possibly powerpc64 (588 bytes, patch)
2018-09-29 05:13 UTC, Nathan
no flags Details | Diff
Fix GCC based archs, keep mips working (3.17 KB, patch)
2018-09-30 02:25 UTC, Nathan
no flags Details | Diff
Fix GCC based archs, keep mips working (4.58 KB, patch)
2018-09-30 02:28 UTC, Nathan
no flags Details | Diff
v3 (495 bytes, patch)
2018-10-18 16:49 UTC, Piotr Kubaj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2018-09-28 12:36:16 UTC
Created attachment 197567 [details]
patch

To build this port on architectures that still use GCC in base, you have to add USES=compiler:c11.

Tested on amd64 and powerpc64.
Comment 1 Nathan 2018-09-29 04:27:44 UTC
Hold off on this one for now, compiler: breaks mips
Comment 2 Nathan 2018-09-29 05:13:08 UTC
Created attachment 197588 [details]
Fixes build on mips, and possibly powerpc64

Test this patch on powerpc64, At first it was not building on mips, but this patch fixes mips issue atleast
Comment 3 Piotr Kubaj freebsd_committer 2018-09-29 17:24:48 UTC
(In reply to Nathan from comment #2)
Yes, that works as well.
Comment 4 Sergey A. Osokin freebsd_committer 2018-09-29 19:05:45 UTC
Hi Piotr,

thanks for the report.

Would you mind to raise this issue and send the patch to upstream?
Comment 5 Nathan 2018-09-29 19:07:36 UTC
(In reply to Sergey A. Osokin from comment #4)
Please use my patch, as it won't break mips, but fix powerpc64
Comment 6 Piotr Kubaj freebsd_committer 2018-09-29 19:08:17 UTC
(In reply to Sergey A. Osokin from comment #4)
I don't think upstream cares about GCC 4.2 :)
Comment 7 Sergey A. Osokin freebsd_committer 2018-09-29 19:24:24 UTC
(In reply to Nathan from comment #5)

Since the patch is related to legacy gcc-specific architectures, would be great to update it to avoid intervention to other modern systems.
Comment 8 Nathan 2018-09-29 19:28:02 UTC
(In reply to Sergey A. Osokin from comment #7)

All I know to target is the ones that are reported to fail, hence why I only put powerpc64 with the USES=compiler:* 

If others fail without that compiler, could add them as well.  I'm just trying to not break mips, while fixing one. If it needs to be added, as last example, it should be last resort and atleast a 2+:1 fix/broken ratio.

If you know other ARCHs that need gcc, let me know and I will add them for the ARCHs.
Comment 9 Piotr Kubaj freebsd_committer 2018-09-29 19:32:31 UTC
(In reply to Nathan from comment #8)
powerpc, powerpcspe and sparc64 also need GCC.
Comment 10 Piotr Kubaj freebsd_committer 2018-09-29 19:34:04 UTC
(In reply to Sergey A. Osokin from comment #7)
Please, don't say "legacy". powerpc64 is very alive both as an architecture (with release of POWER9) and as a FreeBSD port (with recent addition of support for POWER8 and POWER9).

It's far from legacy.
Comment 11 Sergey A. Osokin freebsd_committer 2018-09-29 19:34:44 UTC
Nathan,

I see no reason to patch the source code with the patch on a platform where everything works fine.  This is why I've recommended to update the patch to be more specific on affected platform(s).
Comment 12 Sergey A. Osokin freebsd_committer 2018-09-29 19:37:01 UTC
(In reply to Piotr Kubaj from comment #10)

Piotr,

as you can see I've said legacy regading outdated version of GCC, not a platform.
Comment 13 Nathan 2018-09-30 02:25:24 UTC
Created attachment 197611 [details]
Fix GCC based archs, keep mips working

 databases/redis-devel: Fix build on gcc based platforms
 
 PR:             231780
 Submitted by:   Nathan <ndowens@yahoo.com>


This worked on mips and should work on others
Comment 14 Nathan 2018-09-30 02:28:52 UTC
Created attachment 197612 [details]
Fix GCC based archs, keep mips working

 databases/redis-devel: Fix build on gcc based platforms
 
 PR:             231780
 Submitted by:   Nathan <ndowens@yahoo.com>

Add missing patch
Comment 15 Sergey A. Osokin freebsd_committer 2018-10-14 01:03:55 UTC
Thanks for the patch.

In case this patch is for some specific platforms only, why we need to apply it for all other platforms?

+.if ${COMPILER_TYPE} == clang
+EXTRA_PATCHES=		${PATCHDIR}/extra-patches-src_lzf__d.c
+.endif
Comment 16 Piotr Kubaj freebsd_committer 2018-10-14 07:49:20 UTC
(In reply to Sergey A. Osokin from comment #15)
We can apply it only for the platforms that are broken with this port, but it doesn't harm to apply it everywhere and will simplify Makefile.
Comment 17 Sergey A. Osokin freebsd_committer 2018-10-14 18:43:13 UTC
(In reply to Piotr Kubaj from comment #16)
Would you mind to update the patch then.

Thanks in advance.
Comment 18 Piotr Kubaj freebsd_committer 2018-10-15 14:46:31 UTC
(In reply to Sergey A. Osokin from comment #17)
The general patch that is applied everywhere has already been posted:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197588&action=diff
Comment 19 Sergey A. Osokin freebsd_committer 2018-10-17 01:07:45 UTC
(In reply to Piotr Kubaj from comment #18)
Hi Piotr,

It looks like I'm missing somesothing from your reply.
Could you please explain a reason to use that patch on a platform where everything works just fine without the patch.

Thanks.
Comment 20 Piotr Kubaj freebsd_committer 2018-10-17 08:12:11 UTC
(In reply to Sergey A. Osokin from comment #19)
I wrote in #16 and you asked me to update the patch appropriately:
"We can apply it only for the platforms that are broken with this port, but it doesn't harm to apply it everywhere and will simplify Makefile."

This patch does no harm on platforms that already work and fixes build on platforms that fail to build this port.
Comment 21 Sergey A. Osokin freebsd_committer 2018-10-18 16:33:20 UTC
(In reply to Piotr Kubaj from comment #20)
I don't think I can agree with this.

Again, I see no reason to apply a patch when it fixes nothing or just because it fixes something for other platforms.  This is why I've asked to provide a more specific patch for the port and as far as I see the patch hasn't been updated yet.
Comment 22 Piotr Kubaj freebsd_committer 2018-10-18 16:49:40 UTC
Created attachment 198305 [details]
v3

OK, that was a misunderstanding. Is this patch ok for you? It works for me on powerpc64 and amd64.
Comment 23 commit-hook freebsd_committer 2018-10-18 22:21:28 UTC
A commit references this bug:

Author: osa
Date: Thu Oct 18 22:20:52 UTC 2018
New revision: 482383
URL: https://svnweb.freebsd.org/changeset/ports/482383

Log:
  Fix build on GCC-based architectures.

  PR:	231780

Changes:
  head/databases/redis-devel/Makefile
Comment 24 Sergey A. Osokin freebsd_committer 2018-10-18 22:21:55 UTC
Committed, thanks!