Bug 243653 - www/firefox: fix build on aarch64
Summary: www/firefox: fix build on aarch64
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Some People
Assignee: freebsd-gecko mailing list
URL: http://thunderx1.nyi.freebsd.org/data...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-27 16:09 UTC by Mikael Urankar
Modified: 2020-02-17 11:01 UTC (History)
1 user (show)

See Also:


Attachments
patch (1.28 KB, patch)
2020-01-27 16:09 UTC, Mikael Urankar
no flags Details | Diff
patch (1.76 KB, patch)
2020-02-16 18:11 UTC, Mikael Urankar
no flags Details | Diff
patch (3.84 KB, patch)
2020-02-16 20:43 UTC, Mikael Urankar
jbeich: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Urankar freebsd_committer 2020-01-27 16:09:07 UTC
Created attachment 211106 [details]
patch

The interface has changed a bit on -current:

In file included from Unified_cpp_gfx_skia1.cpp:137:
/wrkdirs/usr/ports/www/firefox/work/firefox-71.0/gfx/skia/skia/src/core/SkCpu.cpp:81:13: error: use of undeclared identifier 'ID_AA64ISAR0_CRC32'
        if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
Comment 1 Mikael Urankar freebsd_committer 2020-02-16 17:00:04 UTC
Is it ok to commit?
Comment 2 Jan Beich freebsd_committer 2020-02-16 17:07:02 UTC
Comment on attachment 211106 [details]
patch

Sorry, I've missed this patch. Can you propagate the same fix to www/cliqz, www/firefox-esr and mail/thunderbird?

> +#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
>++#ifndef ID_AA64ISAR0_CRC32_VAL
>++#define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
>++#endif
> +    #include <machine/armreg.h>

Move #ifndef after #include or it won't have effect.
Comment 3 Mikael Urankar freebsd_committer 2020-02-16 18:11:54 UTC
Created attachment 211696 [details]
patch

Updated patch for firefox and firefox-esr


cliqz seems broken:
===>  Extracting for cliqz-1.32.1_1
=> SHA256 Checksum mismatch for cliqz/adult-domains.bin.
=> SHA256 Checksum OK for cliqz/cliqz@cliqz.com.xpi.
=> SHA256 Checksum OK for cliqz/gdprtool@cliqz.com.xpi.
=> SHA256 Checksum OK for cliqz/https-everywhere@cliqz.com.xpi.
=> SHA256 Checksum OK for cliqz/cliqz-oss-browser-f-1.32.1_GH0.tar.gz.
===>  Refetch for 1 more times files:  cliqz/adult-domains.bin 
===>  License MPL20 accepted by the user
===>   cliqz-1.32.1_1 depends on file: /usr/local/sbin/pkg - found
===>   cliqz-1.32.1_1 depends on package: ca_root_nss>=0 - found
=> adult-domains.bin doesn't seem to exist in /usr/ports/distfiles/cliqz.
=> Attempting to fetch https://s3.amazonaws.com/cdn.cliqz.com/browser-f/APT/adult-domains.bin
adult-domains.bin                                      516 kB 1193 kBps    00s
===> Fetching all distfiles required by cliqz-1.32.1_1 for building
===>  License MPL20 accepted by the user
===>   cliqz-1.32.1_1 depends on file: /usr/local/sbin/pkg - found
===>   cliqz-1.32.1_1 depends on package: ca_root_nss>=0 - found
===> Fetching all distfiles required by cliqz-1.32.1_1 for building
=> SHA256 Checksum mismatch for cliqz/adult-domains.bin.
=> SHA256 Checksum OK for cliqz/cliqz@cliqz.com.xpi.
=> SHA256 Checksum OK for cliqz/gdprtool@cliqz.com.xpi.
=> SHA256 Checksum OK for cliqz/https-everywhere@cliqz.com.xpi.
=> SHA256 Checksum OK for cliqz/cliqz-oss-browser-f-1.32.1_GH0.tar.gz.
===>  Giving up on fetching files:  cliqz/adult-domains.bin 
Make sure the Makefile and distinfo file (/usr/ports/www/cliqz/distinfo)
are up to date.  If you are absolutely sure you want to override this
check, type "make NO_CHECKSUM=yes [other args]".
Comment 4 Jan Beich freebsd_committer 2020-02-16 20:09:40 UTC
Comment on attachment 211696 [details]
patch

(In reply to Mikael Urankar from comment #3)
> +    #include <machine/armreg.h>
> +#ifndef ID_AA64ISAR0_CRC32_VAL
> +#define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
> +#endif

(cosmetic) Can you align whitespace so it looks like the following?

+    #include <machine/armreg.h>
+    #ifndef ID_AA64ISAR0_CRC32_VAL
+    #define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
+    #endif

> Updated patch for firefox and firefox-esr

Without thunderbird? Also this version is broken:

  $ cc a.c
  a.c:15:13: warning: implicit declaration of function 'ID_AA64ISAR0_CRC32' is invalid in C99 [-Wimplicit-function-declaration]
	  if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
	      ^
  a.c:14:24: error: expected readable system register
	  id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1);
			 ^
  /usr/include/machine/armreg.h:61:19: note: expanded from macro 'READ_SPECIALREG'
	  __asm __volatile("mrs   %0, " __STRING(reg) : "=&r" (_val));    \
			   ^
  <inline asm>:1:10: note: instantiated into assembly here
	  mrs     x9, (((3) << 19) | ((0) << 16) | ((0) << 12) | ((6) << 8) | ((0) << 5))
		      ^
  1 warning and 1 error generated.

  $ cat a.c
  #include <stdint.h>
  #include <stdio.h>

  #include <machine/armreg.h>
  #ifndef ID_AA64ISAR0_CRC32_VAL
  #define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
  #endif

  int main(void)
  {
      uint32_t features = 0;
      uint64_t id_aa64isar0;

      id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1);
      if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
	  printf("CRC32 found\n");
      }
  }

> cliqz seems broken:

Then its maintainer can pick up the fix on their own. ;)
Comment 5 Mikael Urankar freebsd_committer 2020-02-16 20:43:49 UTC
Created attachment 211698 [details]
patch

this one includes thunderbird.
Comment 6 Jan Beich freebsd_committer 2020-02-17 11:01:15 UTC
Comment on attachment 211698 [details]
patch

Thanks.