Bug 229602

Summary: databases/mongodb34: add support for aarch64
Product: Ports & Packages Reporter: Ronald Klop <ronald-lists>
Component: Individual Port(s)Assignee: Steve Wills <swills>
Status: Closed FIXED    
Severity: Affects Only Me CC: eric, linimon, swills
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (eric)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to the src of mongodb34
none
patch for port to enable build on aarch64 none

Description Ronald Klop 2018-07-08 09:57:17 UTC
Created attachment 194949 [details]
patch to the src of mongodb34

The attached patch makes it possible to compile mongodb34 for aarch64.
With this I can run net-mgmt/unifi5 on my RPI3.

The patch:
- adds some differences in spelling of defines: _F_ENV_H -> _F_ENV_H_, _WCHAR_T_DECLARED (why did this work on amd64 without these?)
- adds mozjs-45 sources for aarch64/freebsd
  ProcessExecutableMemory is handled differently than on amd64. The aarch64 way looks more in line with what upstream is doing. Amd64 still works.
- disable HAVE_CRC32_HARDWARE on aarch64. Don't know if it should work, but this was the easiest way to make it work for now.
Comment 1 Steve Wills freebsd_committer freebsd_triage 2018-07-09 07:18:33 UTC
Created attachment 194981 [details]
patch for port to enable build on aarch64

Here's an updated patch which applies to the port. While here, I fixed dos line endings in one file and missing new line at end of file in others.
Comment 2 Ronald Klop 2018-07-23 21:26:11 UTC
I got feedback from the mongodb devs on these patches.

https://groups.google.com/d/msgid/mongodb-dev/82862ec6-e2dd-421c-8739-d180d6e532b9%40googlegroups.com?utm_medium=email&utm_source=footer

Overall looks positive. Any chance of a commit in the near future?
Comment 3 Steve Wills freebsd_committer freebsd_triage 2018-07-23 22:05:53 UTC
(In reply to Ronald Klop from comment #2)
Yeah, waiting on maintainer feedback or timeout.
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-07-24 20:03:10 UTC
A commit references this bug:

Author: swills
Date: Tue Jul 24 20:03:05 UTC 2018
New revision: 475271
URL: https://svnweb.freebsd.org/changeset/ports/475271

Log:
  databases/mongodb34: add support for aarch64

  PR:		229602
  Submitted by:	Ronald Klop <ronald-lists@klop.ws>
  Approved by:	maintainer timeout (eric@camachat.org, > 2 weeks)

Changes:
  head/databases/mongodb34/Makefile
  head/databases/mongodb34/files/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_SConscript
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src0.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src1.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src10.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src11.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src12.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src13.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src14.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src15.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src16.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src17.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src18.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src19.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src2.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src20.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src21.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src22.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src23.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src24.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src25.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src26.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src27.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src28.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src29.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src3.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src30.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src31.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src32.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src33.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src4.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src5.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src6.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src7.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src8.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_Unified__cpp__js__src9.cpp
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_build_js-confdefs.h
  head/databases/mongodb34/files/patch-src_third__party_mozjs-45_platform_aarch64_freebsd_include_js-config.h
  head/databases/mongodb34/files/patch-src_third__party_wiredtiger_SConscript
Comment 5 Steve Wills freebsd_committer freebsd_triage 2018-07-24 20:04:23 UTC
Committed, thanks!
Comment 6 Ronald Klop 2018-07-24 20:31:51 UTC
Thanks!

I think we miss this useful piece. ;-)

# diff -u Makefile.orig Makefile                                                                 
--- Makefile.orig       2018-07-24 22:28:55.481853000 +0200                                                                                  
+++ Makefile    2018-07-24 22:29:47.570409000 +0200                                                                                          
@@ -20,8 +20,8 @@                                                                                                                            
                                                                                                                                             
 BROKEN_SSL=    openssl-devel                                                                                                                
 BROKEN_SSL_REASON_openssl-devel=       no member named 'SSLv2_method' in the global namespace                                               
-ONLY_FOR_ARCHS=        amd64                                                                                                                
-ONLY_FOR_ARCHS_REASON= "Only supported on amd64 (i386 deprecated in v3)"                                                                    
+ONLY_FOR_ARCHS=        amd64 aarch64                                                                                                        
+ONLY_FOR_ARCHS_REASON= "Only supported on amd64 and aarch64 (i386 deprecated in v3)"                                                        
                                                                                                                                             
 LIB_DEPENDS=   libpcre.so:devel/pcre \                                                                                                      
                libsnappy.so:archivers/snappy \
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-07-27 10:50:58 UTC
A commit references this bug:

Author: swills
Date: Fri Jul 27 10:50:10 UTC 2018
New revision: 475424
URL: https://svnweb.freebsd.org/changeset/ports/475424

Log:
  databases/mongodb34: add support for aarch64

  Commit important part of PR missed in previous commit.

  PR:		229602
  Submitted by:	Ronald Klop <ronald-lists@klop.ws>
  Reported by:	Ronald Klop <ronald-lists@klop.ws>
  Approved by:	eric@camachat.org (maintainer timeout, > 2 weeks)
  Pointyhat to:	swills

Changes:
  head/databases/mongodb34/Makefile