Bug 231779

Summary: security/tor: fix build with mips64, powerpc64 and sparc64
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Yuri Victorovich <yuri>
Status: Closed FIXED    
Severity: Affects Only Me CC: linimon, ndowens, pkubaj
Priority: --- Flags: bugzilla: maintainer-feedback? (yuri)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch
none
Patch none

Description Piotr Kubaj freebsd_committer 2018-09-28 12:12:54 UTC
Created attachment 197566 [details]
patch

mips64, powerpc64 and sparc64 need newer compiler to build this port, USES=compiler:c11 fixes that.

Tested on amd64 and powerpc64.

Hardware sponsored by IntegriCloud.
Comment 1 Nathan 2018-09-28 23:19:03 UTC
adding compiler:c++11* does not fix build on MIPS/MIPS64, as it requires GCC(not available on mips)
Comment 2 Yuri Victorovich freebsd_committer 2018-09-29 00:37:44 UTC
(In reply to Nathan from comment #1)

Tor code is c11. IMO, USES=compiler:c11 should work. If it doesn't work on MIPS, this looks like a bug (wrong compiler is triggered by this flag), and a bug against Mk/Uses/compiler.mk should be created.
Comment 3 Nathan 2018-09-29 00:44:12 UTC
(In reply to Yuri Victorovich from comment #2)
Yea adding compiler:c* tends to trigger gcc requirement
Comment 4 Yuri Victorovich freebsd_committer 2018-09-29 00:53:19 UTC
(In reply to Nathan from comment #3)

If you have observed that USES=compiler:c11 introduces the compiler that isn't C11-compatible, you should create a bug report for this.
Comment 5 Yuri Victorovich freebsd_committer 2018-09-29 01:22:38 UTC
I tried to add USE_CSTD=c99, USE_CSTD=c11, USE_CSTD=c17, USE_CSTD=gnu89 - compilation breaks with all of them.

I don't quite understand how can this be possible: compiler by default has to match one of these.
Comment 6 Nathan 2018-09-29 01:24:02 UTC
(In reply to Yuri Victorovich from comment #5)
Which is probably why gcc gets pulled when using compiler:c* as using the USE_C*STD= doesn't work
Comment 7 Nathan 2018-09-29 02:02:06 UTC
Created attachment 197584 [details]
Patch

Try this patch; Builds on mips with it. If it doesn't build on powerpc, can do another way to satisfy both
Comment 8 Yuri Victorovich freebsd_committer 2018-09-29 02:14:34 UTC
(In reply to Nathan from comment #7)

You only added USES=autoreconf? Why does this change things?
Comment 9 Nathan 2018-09-29 02:16:41 UTC
(In reply to Yuri Victorovich from comment #8)
Seems autoreconf regens the configure file. Before I added that, it wouldn't build on mips. Adding that caused configure to be rebuilt and then it compiled
Comment 10 Yuri Victorovich freebsd_committer 2018-09-29 02:23:52 UTC
(In reply to Nathan from comment #9)

This also is because of some bug in Tor: with and without autoreconf should build the same.
Comment 11 Nathan 2018-09-29 02:24:45 UTC
(In reply to Yuri Victorovich from comment #10)
No idea. but it worked for me is all I can say.
Comment 12 Yuri Victorovich freebsd_committer 2018-09-29 02:25:00 UTC
They might use an outdated system to generate the configure script.
Comment 13 Yuri Victorovich freebsd_committer 2018-09-29 02:29:16 UTC
https://trac.torproject.org/projects/tor/ticket/27901
Comment 14 commit-hook freebsd_committer 2018-09-30 01:55:53 UTC
A commit references this bug:

Author: yuri
Date: Sun Sep 30 01:55:04 UTC 2018
New revision: 480932
URL: https://svnweb.freebsd.org/changeset/ports/480932

Log:
  security/tor: Fix build with mips64, powerpc64 and sparc64

  Port changes:
  * Add USES=compiler:c11
  * Add USE_CSTD=gnu99

  Situation with MIPS isn't clear, Nathan <ndowens@yahoo.com> says that it works only after adding USES=autoreconf.
  The Tor Project should resolve this discrepancy that autoreconf alters the outcome: https://trac.torproject.org/projects/tor/ticket/27901

  PR:		231779
  Submitted by:	Piotr Kubaj <pkubaj@anongoth.pl> (initial version)

Changes:
  head/security/tor/Makefile
Comment 15 commit-hook freebsd_committer 2018-09-30 01:56:56 UTC
A commit references this bug:

Author: yuri
Date: Sun Sep 30 01:56:16 UTC 2018
New revision: 480933
URL: https://svnweb.freebsd.org/changeset/ports/480933

Log:
  security/tor-devel: Fix build with mips64, powerpc64 and sparc64

  Port changes:
  * Add USES=compiler:c11
  * Add USE_CSTD=gnu99

  PR:		231779
  Submitted by:	Piotr Kubaj <pkubaj@anongoth.pl> (initial version)

Changes:
  head/security/tor-devel/Makefile
Comment 16 Yuri Victorovich freebsd_committer 2018-09-30 01:57:13 UTC
Committed, thanks.