From nobody Mon May 29 19:53:44 2023 X-Original-To: freebsd-arch@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 4QVR6s4j65z4Wq7Z for ; Mon, 29 May 2023 19:53:57 +0000 (UTC) (envelope-from pierre@freebsdfoundation.org) Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QVR6r5GQPz4JMS for ; Mon, 29 May 2023 19:53:56 +0000 (UTC) (envelope-from pierre@freebsdfoundation.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=freebsdfoundation.org header.s=gfnp-20170908 header.b="e0PM/SW2"; spf=pass (mx1.freebsd.org: domain of pierre@freebsdfoundation.org designates 2607:f8b0:4864:20::b2e as permitted sender) smtp.mailfrom=pierre@freebsdfoundation.org; dmarc=none Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-ba8374001abso5279097276.2 for ; Mon, 29 May 2023 12:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsdfoundation.org; s=gfnp-20170908; t=1685390036; x=1687982036; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CtdE76udItCQWe3tJK1IP70zbSB/Zep70bh/wb24UBQ=; b=e0PM/SW2YrldDs/X1Z314cf65QBc0iTtedihTWGWjZe0e92PRGkJPA7PcTT2PaALyr ccP95JChOA6TRRb0JMtrN/3VBuSoKWBZjiVXWZTVBnzsMRbb6XW2jKtUR9Bq4M8ZPUNk kaWjOvo/wkmOS16HhiWPRvYmV0heVUb6p08fwAeuhS80u0dBZgv/sG7wH3BZhuTruecS DQ/763On1YoXLvrAPRHGsfQo6SdCtKWUEgq7Xg8lU1E31ejcSj50PDg/+W8RFMd5H0CT qvg6N5eRf4etud3rugMC4bV81QPJjFUri7djEd8jUGcQvr7Me5BZY6spOMk7LdfJDe1s j6pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685390036; x=1687982036; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CtdE76udItCQWe3tJK1IP70zbSB/Zep70bh/wb24UBQ=; b=jZlkS/FgvjRVnrHq6+3rQjdTu3wcYwMp9hES6SwDtk3rvyYWqg7gEWXKiNJ77gDuRi 6aKmFKFLxfNAJ2ct/K11IXmeB6ykSueDhM2YRhSXFRBTftG0tqhM+toSr0GDby9NrvWQ zMx9T8nXZaobQKkxWWj8w+W3KJmMTfD1e1qJb/2J2kepwzmgSQnWrRKTsH2yjEjq8Fa+ WIO9BDffqGOubpBFaLwgW/ozJVAb26S+koq04D1f411F/eBf977hnVRqRrVQ7zopw6/I FHwSnptKN5rV1NV5EE+BQGVAhcAc1bOhgcw5IZpi0GexoyKmWnmvx/6JPvglWuiQ1jMx yFkA== X-Gm-Message-State: AC+VfDx3EIF1xXD2Ktr3iPUZlzGYuZUV259Xo3WydY5Qp5K5aO9ygI5Y lyShPA3xC7LDZ7BVu3JBu9WczYro4gHvFm8VzQK8GCRt X-Google-Smtp-Source: ACHHUZ6Nw5k25zzJW6CY0gNLdehjM7aqNkUpGxEAWi43W7ioIcgfUIQFlY6yyiZ6LCdNVhImSr+q2wJQoxZrLh3KFeY= X-Received: by 2002:a0d:d854:0:b0:565:9e48:2597 with SMTP id a81-20020a0dd854000000b005659e482597mr11795696ywe.50.1685390035946; Mon, 29 May 2023 12:53:55 -0700 (PDT) List-Id: Discussion related to FreeBSD architecture List-Archive: https://lists.freebsd.org/archives/freebsd-arch List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arch@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Pierre Pronchery Date: Mon, 29 May 2023 13:53:44 -0600 Message-ID: Subject: Re: OpenSSL 3.0 for 14.0-RELEASE: issues with 1.x/3.x symbol clashing, ports linking against base OpenSSL, ports that don't compile/link against OpenSSL 3, etc To: Kyle Evans Cc: Enji Cooper , Antoine Brodin , freebsd-arch@freebsd.org Content-Type: multipart/alternative; boundary="00000000000066a7b105fcda72fe" X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[freebsdfoundation.org:s=gfnp-20170908]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arch@freebsd.org]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b2e:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_LAST(0.00)[]; BLOCKLISTDE_FAIL(0.00)[2607:f8b0:4864:20::b2e:server fail]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[freebsdfoundation.org:+]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[freebsdfoundation.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QVR6r5GQPz4JMS X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N --00000000000066a7b105fcda72fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Kyle, everyone, Thanks for the hints! Unfortunately I am still not able to make your solution work. With "SUBDIR_DEPEND_modules=3D libcrypto" (no "S") and "SUBDIR_PARALLEL=3D" the build fails with: "make[4]: make[4]: don't know how to make all_subdir_secure/lib/libcrypto/libcrypto. Stop" I'm looking at other places in the source tree to try to reproduce the behaviour we want. In the meantime what I did is to remove LIBADD=3Dcrypto in modules/Makefile.inc, but I am not sure yet if this is going to work or not= . Cheers, -- Pierre On Thu, May 11, 2023 at 9:45=E2=80=AFAM Kyle Evans wro= te: > On Thu, May 11, 2023 at 9:54=E2=80=AFAM Enji Cooper wrote: > > > > > > > On May 11, 2023, at 00:23, Antoine Brodin wrote= : > > > > > > =EF=BB=BFOn Thu, May 11, 2023 at 6:31=E2=80=AFAM Pierre Pronchery > > > wrote: > > >> > > >> Hi everyone, > > >> > > >> It's been a long and tough fight, but I finally managed to complete = a > > >> `make buildworld` on amd64 with the latest state of my work on OpenS= SL > > >> 3; see https://github.com/freebsd/freebsd-src/pull/740 for a first > draft > > >> of a pull-request via GitHub. > > >> > > >> I will probably not be able to work on this again until the DevSummi= t > at > > >> BSDCan, so feel free to take it from there until then. > > >> > > >> HTH! > > >> -- khorben > > > > > > Thanks, I have this error during buildworld: > > > > > > =3D=3D=3D> secure/lib/libcrypto/modules/fips (all) > > > make[6]: > /usr/obj/poudriere/data/src-openssl3/amd64.amd64/secure/lib/libcrypto/mod= ules/fips/.depend, > > > 1: ignoring stale .depend for > > > > /usr/obj/poudriere/data/src-openssl3/amd64.amd64/tmp/usr/lib/libcrypto.a > > > building shared library fips.so > > > cc -target x86_64-unknown-freebsd14.0 > > > --sysroot=3D/usr/obj/poudriere/data/src-openssl3/amd64.amd64/tmp > > > -B/usr/obj/poudriere/data/src-openssl3/amd64.amd64/tmp/usr/bin > > > -Wl,-zrelro -fstack-protector-strong -shared -Wl,-x > > > -Wl,--fatal-warnings -Wl,--warn-shared-textrel -o fips.so.full > > > -Wl,-soname,fips.so fips_entry.pico fipsprov.pico self_test.pico > > > self_test_kats.pico -lcrypto > > > ld: error: unable to find library -lcrypto > > > cc: error: linker command failed with exit code 1 (use -v to see > invocation) > > > *** Error code 1 > > > > Good find! > > > > The modules directory will likely need to be built in a later stage of > world (after libcrypto has been installed). That, or LDFLAGS needs to be > adjusted to find libcrypto in the build tree. > > > > I suspect it's a fairly simple one, actually: move all of the parts > that actually build libcrypto into a subdir of secure/lib/libcrypto > and make sure there's a proper SUBDIR_DEPENDS_modules=3D libcrypto. The > module is built in secure/lib/libcrypto/Makefile, but I would guess > either it's racing the build of modules/ (SUBDIR) against the build of > the module in the parent Makefile, or it's just going to build the > SUBDIR first every time. I don't recall the exact behavior of make > here. > > libcrypto is in _prebuild_libs, but I don't think we have any way you > can actually tell we're in the prebuild phase to avoid SUBDIR'ing in > the modules/ while we're doing the earlier build. If we did, the later > all pass should descend back into libcrypto/ and do nothing for the > lib itself but build the modules. > > Thanks, > > Kyle Evans > --00000000000066a7b105fcda72fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Kyle, everyone,

Thanks for the= hints!

Unfortunately I am still not able to make your s= olution work. With "SUBDIR_DEPEND_modules=3D libcrypto" (no "= ;S") and "SUBDIR_PARALLEL=3D" the build fails with:
"make[4]: make[4]: don't know how to make all_subdir_secure/lib/= libcrypto/libcrypto. Stop"

I'm looking at= other places in the source tree to try to reproduce the behaviour we want.=

In the meantime what I did is to remove LIBADD=3D= crypto in modules/Makefile.inc, but I am not sure yet if this is going to w= ork or not.

Cheers,
-- Pierre

On Th= u, May 11, 2023 at 9:45=E2=80=AFAM Kyle Evans <kevans@freebsd.org> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);pa= dding-left:1ex">On Thu, May 11, 2023 at 9:54=E2=80=AFAM Enji Cooper <yaneurabeya@gmail.c= om> wrote:
>
>
> > On May 11, 2023, at 00:23, Antoine Brodin <antoine@freebsd.org> wrote: > >
> > =EF=BB=BFOn Thu, May 11, 2023 at 6:31=E2=80=AFAM Pierre Pronchery=
> > <pierre@freebsdfoundation.org> wrote:
> >>
> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Hi eve= ryone,
> >>
> >> It's been a long and tough fight, but I finally managed t= o complete a
> >> `make buildworld` on amd64 with the latest state of my work o= n OpenSSL
> >> 3; see https://github.com/freebsd/freeb= sd-src/pull/740 for a first draft
> >> of a pull-request via GitHub.
> >>
> >> I will probably not be able to work on this again until the D= evSummit at
> >> BSDCan, so feel free to take it from there until then.
> >>
> >> HTH!
> >> -- khorben
> >
> > Thanks,=C2=A0 I have this error during buildworld:
> >
> > =3D=3D=3D> secure/lib/libcrypto/modules/fips (all)
> > make[6]: /usr/obj/poudriere/data/src-openssl3/amd64.amd64/secure/= lib/libcrypto/modules/fips/.depend,
> > 1: ignoring stale .depend for
> > /usr/obj/poudriere/data/src-openssl3/amd64.amd64/tmp/usr/lib/libc= rypto.a
> > building shared library fips.so
> > cc -target x86_64-unknown-freebsd14.0
> > --sysroot=3D/usr/obj/poudriere/data/src-openssl3/amd64.amd64/tmp<= br> > > -B/usr/obj/poudriere/data/src-openssl3/amd64.amd64/tmp/usr/bin > > -Wl,-zrelro=C2=A0 =C2=A0-fstack-protector-strong -shared -Wl,-x > > -Wl,--fatal-warnings -Wl,--warn-shared-textrel=C2=A0 -o fips.so.f= ull
> > -Wl,-soname,fips.so fips_entry.pico fipsprov.pico self_test.pico<= br> > > self_test_kats.pico=C2=A0 -lcrypto
> > ld: error: unable to find library -lcrypto
> > cc: error: linker command failed with exit code 1 (use -v to see = invocation)
> > *** Error code 1
>
> Good find!
>
> The modules directory will likely need to be built in a later stage of= world (after libcrypto has been installed). That, or LDFLAGS needs to be a= djusted to find libcrypto in the build tree.
>

I suspect it's a fairly simple one, actually: move all of the parts
that actually build libcrypto into a subdir of secure/lib/libcrypto
and make sure there's a proper SUBDIR_DEPENDS_modules=3D libcrypto. The=
module is built in secure/lib/libcrypto/Makefile, but I would guess
either it's racing the build of modules/ (SUBDIR) against the build of<= br> the module in the parent Makefile, or it's just going to build the
SUBDIR first every time. I don't recall the exact behavior of make
here.

libcrypto is in _prebuild_libs, but I don't think we have any way you can actually tell we're in the prebuild phase to avoid SUBDIR'ing i= n
the modules/ while we're doing the earlier build. If we did, the later<= br> all pass should descend back into libcrypto/ and do nothing for the
lib itself but build the modules.

Thanks,

Kyle Evans
--00000000000066a7b105fcda72fe--