From nobody Sun Jun 27 10:55:32 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8E82511C9012; Sun, 27 Jun 2021 10:55:46 +0000 (UTC) (envelope-from webplication@gmail.com) Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GCSMP00Btz3lwh; Sun, 27 Jun 2021 10:55:44 +0000 (UTC) (envelope-from webplication@gmail.com) Received: by mail-ot1-x32d.google.com with SMTP id 7-20020a9d0d070000b0290439abcef697so15199778oti.2; Sun, 27 Jun 2021 03:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=Ua2CPG4XGmkX0d6bSmkaMmic77uf/dYuX6yEaQPuq1M=; b=p/fgHFjby5Go7Hap37W4WLpreaJjfe+wDJw1mk8vH3Q36I3b7dU39t6qWR3cL48MY8 nwKFJSACO+TNHbovvqBeG8M9ZewOooww3JD87dDv5bjQEe4tSGM2gnmtW5Hw7E6Nxy8c f3Hfd6DmxpJVt9fgTEJVwGo/Ujr6zw5OKWWNqVhJLeM/0Q7VcKNyXJKRhGIv8siPiOUA 6Kbid6Uc6PTx4qNgIDtWUaPhp56HhkTi0y9sxXP3ZTToB1kl4hfIVyaId1SXvKNjEFAe JlY574DbCz/UA/O8H0ePZmKaI7sNGKfjo4BfTL99tlXBl6PJgStNtVzxYScfJjulrcrr 24Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Ua2CPG4XGmkX0d6bSmkaMmic77uf/dYuX6yEaQPuq1M=; b=URFEotU2ztPee+Vq77Zt3DRxqD3ITt53Iz17w9Rxvb+O77b7jy1v3W8MfoLPHaaxT+ 4ftQ7yUqYvWDPz8kbkFXhEU1yT5feJyZRIzNlGFNEZ6fG6+Vdw1utbIoX9erbGpg1qT6 cOVVU172raTMhZl4PS724suMRBAqq8p6FBTXLiFGm1a5eZyJt3kHAh9btp63us+CNb06 Ixa2EIk2fcI+AyBZdqQlim0YlTFAbTtWPvjOde+sRwZS2vJc2atiSnsQ4u4KEAyDwiI5 jcExrat9GJbpdUweNC+OE8m9himhNTCTKVwBUIBCAlUin8BVyCDDqDduVHyzshOeG/mz dY9g== X-Gm-Message-State: AOAM533ukd7OES7jp0bsXmDZgVCG0tIiklUxKWzWQ2PylXlG4TMnQmHm V6q79Z5/HVJAtH1kmTvZCgM6nCQw3a4Nd113Pzs/2TAgViH+rSAyUAo= X-Google-Smtp-Source: ABdhPJwg6xKh+EBGA6MCghjc9pVASrfFSzGItPOwJdTAgZ2qoUio4kyurTZX7ouBH+Rp7qLmQYmVmMEA4AfypS20tQY= X-Received: by 2002:a05:6830:99:: with SMTP id a25mr324351oto.19.1624791343631; Sun, 27 Jun 2021 03:55:43 -0700 (PDT) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 From: J P Date: Sun, 27 Jun 2021 12:55:32 +0200 Message-ID: Subject: FreeBSD ocaml support for aarch64 To: freebsd-ports@freebsd.org, freebsd-arm@freebsd.org Cc: michipili@gmail.com Content-Type: multipart/alternative; boundary="000000000000df10a505c5bd3637" X-Rspamd-Queue-Id: 4GCSMP00Btz3lwh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=p/fgHFjb; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of webplication@gmail.com designates 2607:f8b0:4864:20::32d as permitted sender) smtp.mailfrom=webplication@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::32d:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::32d:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::32d:from]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-ports,freebsd-arm]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: Y --000000000000df10a505c5bd3637 Content-Type: text/plain; charset="UTF-8" Hi, lang/ocaml port is marked as broken on aarch64 and I would like to contribute and have it fixed. The broken reason is incorrect as of now: BROKEN_aarch64= Does not build: sh: as: not found If I comment this line out, "as" is correctly found given the port dependency from binutils: BUILD_DEPENDS= as:devel/binutils The build process stops with: ld: error: can't create dynamic relocation R_AARCH64_LDST64_ABS_LO12_NC against symbol: camlUnix in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in unix.a(unix.o) >>> referenced by unix.ml:863 >>> unix.o:(camlUnix__waitpid_non_intr_1853) in archive unix.a ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors) cc: error: linker command failed with exit code 1 (use -v to see invocation) File "caml_startup", line 1: Error: Error during linking gmake[4]: *** [../Makefile:74: unix.cmxs] Error 2 gmake[4]: Leaving directory '/wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.05.0/otherlibs/unix' gmake[3]: *** [Makefile:1055: otherlibrariesopt] Error 2 gmake[3]: Leaving directory '/wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.05.0' gmake[2]: *** [Makefile:465: opt.opt] Error 2 gmake[2]: Leaving directory '/wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.05.0' gmake[1]: *** [Makefile:531: world.opt] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/ocaml/work/ocaml-4.05.0' *** Error code 1 Stop. make: stopped in /usr/ports/lang/ocaml Trying to fix this issue by adding -fPIC to CONFIGURE_ARGS does nothing, in the sense that the option actually adds -fPIC to ld args, but the error remains. So I went the other way and changed LDFLAGS as suggested by the error message: LDFLAGS_aarch64= -Wl,-z,notext In this case I hit an obscure error when making with make -j : boot/ocamlrun ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink -strict-sequence -principal -absname -w +a-4-9-41-42-44-45-48 -warn-error A -bin-annot -safe-string -strict-formats -I utils -I parsing -I typing -I bytecomp -I middle_end -I middle_end/base_types -I asmcomp -I driver -I toplevel -c middle_end/simplify_boxed_integer_ops.ml File "/usr/ports/lang/ocaml/work/ocaml-4.05.0/_none_", line 1: Warning 58: no cmx file was found in path for module Compilenv, and its interface was not compiled with -opaque boot/ocamlrun ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink -strict-sequence -principal -absname -w +a-4-9-41-42-44-45-48 -warn-error A -bin-annot -safe-string -strict-formats -I utils -I parsing -I typing -I bytecomp -I middle_end -I middle_end/base_types -I asmcomp -I driver -I toplevel -c middle_end/simplify_primitives.ml File "/usr/ports/lang/ocaml/work/ocaml-4.05.0/asmcomp/selection.ml", line 1: Error: Some fatal warnings were triggered (1 occurrences) gmake[4]: *** [Makefile:1270: asmcomp/selection.cmx] Error 2 gmake[4]: *** Waiting for unfinished jobs.... gmake[4]: Leaving directory '/usr/ports/lang/ocaml/work/ocaml-4.05.0' gmake[3]: *** [Makefile:464: opt.opt] Error 2 gmake[3]: Leaving directory '/usr/ports/lang/ocaml/work/ocaml-4.05.0' gmake[2]: *** [Makefile:531: world.opt] Error 2 gmake[2]: Leaving directory '/usr/ports/lang/ocaml/work/ocaml-4.05.0' *** [do-build] Error code 1 make[1]: stopped in /usr/ports/lang/ocaml 1 error make[1]: stopped in /usr/ports/lang/ocaml *** [stage] Error code 2 make: stopped in /usr/ports/lang/ocaml 1 error make: stopped in /usr/ports/lang/ocaml If I continue without -j, ld fails with a similar error: ld: error: relocation R_AARCH64_LDST64_ABS_LO12_NC cannot be used against symbol camlUnix; recompile with -fPIC Note: -fPIC is enabled. I am stuck, can someone suggest how to proceed? Thank you. BR, --000000000000df10a505c5bd3637--