From nobody Sat Nov 26 16:26:40 2022 X-Original-To: freebsd-database@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 4NKHDg4mdfz4hVrH for ; Sat, 26 Nov 2022 16:26:43 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) (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 4NKHDf39Rlz40Jx for ; Sat, 26 Nov 2022 16:26:42 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=WJVC75u+; spf=pass (mx1.freebsd.org: domain of archimedes.gaviola@gmail.com designates 2607:f8b0:4864:20::112b as permitted sender) smtp.mailfrom=archimedes.gaviola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-36cbcda2157so67159407b3.11 for ; Sat, 26 Nov 2022 08:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yPKUhG1KaG4fQpsa6W3Iw8mgLE6HdWfPnW4Ar51vTUU=; b=WJVC75u+BixzbsbieEXy7xFL8jfbnlXf+Je0v4OAJBNUawksQQ56R7qNJqB5RHbmz5 0qb++KHJzSucbNCTi1w5E+WvrwLwbpa0IaBqQoYidwQ4tNysuTHDg3URnL6QLF528s4O f/pa4e1LZk2EZftQfl0FJeGzeOIxo0EBXBfdpI5BW9p+Hu1jKnlazUXKTxuywROurydM 37/sb+gJCwRY2Ekq/n8w2kzgVRJEsLvMXuN832WoYSW24vqe2ATsq9G8yBalges9kHSH ER8QfeA0rGNiX3If15oy4pwN3Akea4uTNBnxAa/Lz8hV+DHg3kIH3dzkO87c8VuhhIHh rrDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=yPKUhG1KaG4fQpsa6W3Iw8mgLE6HdWfPnW4Ar51vTUU=; b=D8gFS7LFmooYhCr9NHJFv2qO3eELSD0WGtk9J9tFMgCpIYxn7Gdffnqdp2DKpV1BoL Gkyc9UNZmFbnh28uzmEcWqLDMeBaHmnMiBoYJ0rpEPSJYDv7JgVRa3dLzBnNjyFVCtRj vcyJ+KnKORPpXblbnJ/bmiYVf83m/3nGn2w4Xt+BVkqhQTA39CjDNQ90lK3MiaElFwNQ JOinWxXlv0Rj3Wz6AeGWFDK5ix5Ww4JBwwFmdjZtEtaWZzYajm42xXvUzHqn66iSQMMt YfXkRMStF1Z3YZaJsCt4TxzMQo/nuxTttvyoPfGLEFWn6PoaCD+9Ud/tuaP0oflQmVeu uW1A== X-Gm-Message-State: ANoB5pl9In72RqFjf6Siq2sfO/Eb6Y5bYQ6woxGuwfpX3nrWpjHrZhfC IAxFXeV2CbQK3hLEUwcTC88MuZd+3S7MjFqOHb8= X-Google-Smtp-Source: AA0mqf7nRrZLmyZFnzyS7QA1Gof7WkQ265Zz4AuOgQxIPJpP5zxD5RsUKAY2tBQNFh1aCVMZf2v4RGa67dSwqfzqeDs= X-Received: by 2002:a0d:d481:0:b0:3a5:9a11:db48 with SMTP id w123-20020a0dd481000000b003a59a11db48mr24435644ywd.138.1669479995011; Sat, 26 Nov 2022 08:26:35 -0800 (PST) List-Id: Database use and development under FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-database List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-database@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Archimedes Gaviola Date: Sun, 27 Nov 2022 00:26:40 +0800 Message-ID: Subject: Re: Include SQLite3 source upon buildworld To: Xin LI Cc: freebsd-database@freebsd.org Content-Type: multipart/alternative; boundary="0000000000000ff9f905ee621a92" X-Spamd-Result: default: False [-3.98 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.979]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-database@freebsd.org]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::112b:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-database@freebsd.org]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4NKHDf39Rlz40Jx X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N --0000000000000ff9f905ee621a92 Content-Type: text/plain; charset="UTF-8" On Sat, Nov 26, 2022 at 5:24 PM Archimedes Gaviola < archimedes.gaviola@gmail.com> wrote: > > > On Wed, Nov 16, 2022 at 10:06 AM Archimedes Gaviola < > archimedes.gaviola@gmail.com> wrote: > >> >> >> On Wed, Nov 16, 2022 at 1:48 AM Xin LI wrote: >> >>> >>> >>> On Tue, Nov 15, 2022 at 5:16 AM Archimedes Gaviola < >>> archimedes.gaviola@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> There's an SQLite3 source located in the /usr/src/contrib/sqlite3. Is >>>> there a way to include this upon buildworld so that I can run the binary >>>> after compiling? >>>> >>> >> Hi Xin Li, >> >> >>> Yes and no. >>> >>> Yes -- you can always compile shell.c source and link against the >>> library; the code is there, just the BSD make build glues are missing. >>> >> >> Okay, nice! I'm so glad that it can be done. My goal is to make SQLite3 >> be part of the base system in a customized FreeBSD build to make it >> embedded. I am checking the version and it's updated 3.93.3 as I'm using >> the 14.0-CURRENT. I need to figure-out this BSD make and glues you've >> mentioned to make this happen. >> >> No -- the omission is intentional: the library is meant to be used by the >>> base system as a "private library", which gives us the flexibility to not >>> give a stable API/ABI promise and to only build with options that the base >>> system needed (to reduce attack surface), so that when we make an update, >>> it will be a "wholesale" update and user applications are not broken, even >>> if sqlite3 update have introduced one. Users who want sqlite3 should >>> really install it from ports (databases/sqlite3) or package. >>> >> >> Oh I see, now I know its purpose. Currently, I have my system installed >> with SQLite3 via package install 'pkg install sqlite3' and it works very >> well but because this time I want something embeddable. It so happened that >> I was checking the source and surprisingly found sqlite3. Anyway, let me >> explore and try. >> >> Thanks and best regards, >> Archimedes >> > > Hi Xin LI, > > I added the new sqlite3 folder in the /usr/src/usr.bin/sqlite3 with the > Makefile file as content and then reference the /usr/src/contrib/sqlite3 > directory as source. > > root@generic:/usr/src/usr.bin/sqlite3 # ls -la > total 16 > drwxr-xr-x 2 root wheel 512 Nov 26 12:46 . > drwxr-xr-x 279 root wheel 5120 Nov 26 12:46 .. > -rw-r--r-- 1 root wheel 295 Nov 26 16:50 Makefile > > root@generic:/usr/src/usr.bin/sqlite3 # cat Makefile > # $FreeBSD$ > > .include > > SQLITE= ${SRCTOP}/contrib/sqlite3 > .PATH: ${SQLITE} > > PROG= sqlite3 > MK_MAN=no > SRCS= sqlite3.c > INCS= shell.c sqlite3.h > > WARNS?= 3 > CFLAGS+= -I${SQLITE} \ > -DSQLITE_THREADSAFE=0 \ > -DSQLITE_OMIT_LOAD_EXTENSION > > .include > > and perform the 'make' command. However, I encountered this error -> ld: > error: undefined symbol: main as referenced to the crt1_c.c:72 > (/usr/src/lib/csu/aarch64/crt1_c.c:72) file. > > root@generic:/usr/src/usr.bin/sqlite3 # make > cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 > -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=zlib > -MD -MF.depend.sqlite3.o -MTsqlite3.o -std=gnu99 -Wno-format-zero-length > -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body > -Wno-string-plus-int -Wno-unused-const-variable > -Wno-error=unused-but-set-variable -Wno-tautological-compare > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function > -Wno-enum-conversion -Wno-unused-local-typedef > -Wno-address-of-packed-member -Qunused-arguments -c > /usr/src/contrib/sqlite3/sqlite3.c -o sqlite3.o > cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 -DSQLITE_THREADSAFE=1 > -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=zlib -std=gnu99 > -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror > -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable > -Wno-error=unused-but-set-variable -Wno-tautological-compare > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function > -Wno-enum-conversion -Wno-unused-local-typedef > -Wno-address-of-packed-member -Qunused-arguments -Wl,-zrelro -pie -o > sqlite3.full sqlite3.o -L/usr/obj/usr/src/arm64.aarch64/lib/libthr > -lpthread > ld: error: undefined symbol: main > >>> referenced by crt1_c.c:72 (/usr/src/lib/csu/aarch64/crt1_c.c:72) > >>> /usr/lib/Scrt1.o:(__start) > cc: error: linker command failed with exit code 1 (use -v to see > invocation) > *** Error code 1 > > Stop. > make: stopped in /usr/src/usr.bin/sqlite3 > > Not sure if I missed something or if something goes wrong with my Makefile > content construction. I basically followed from here > https://www.sqlite.org/howtocompile.html and then proved the source to > compile successfully. > > root@generic:/usr/src/contrib/sqlite3 # pwd > /usr/src/contrib/sqlite3 > root@generic:/usr/src/contrib/sqlite3 # ls -lah > total 11364 > drwxr-xr-x 3 root wheel 1.0K Oct 27 08:06 . > drwxr-xr-x 89 root wheel 2.0K Nov 26 13:01 .. > -rw-r--r-- 1 root wheel 15K Oct 27 08:06 INSTALL > -rw-r--r-- 1 root wheel 729B Oct 27 08:06 Makefile.am > -rw-r--r-- 1 root wheel 547B Oct 27 08:06 Makefile.fallback > -rw-r--r-- 1 root wheel 37K Oct 27 08:06 Makefile.in > -rw-r--r-- 1 root wheel 28K Oct 27 08:06 Makefile.msc > -rw-r--r-- 1 root wheel 3.5K Oct 27 08:06 README.txt > -rw-r--r-- 1 root wheel 7.1K Oct 27 08:06 Replace.cs > -rw-r--r-- 1 root wheel 365K Oct 27 08:06 aclocal.m4 > -rwxr-xr-x 1 root wheel 7.2K Oct 27 08:06 compile > -rwxr-xr-x 1 root wheel 48K Oct 27 08:06 config.guess > -rwxr-xr-x 1 root wheel 35K Oct 27 08:06 config.sub > -rwxr-xr-x 1 root wheel 485K Oct 27 08:06 configure > -rw-r--r-- 1 root wheel 8.5K Oct 27 08:06 configure.ac > -rwxr-xr-x 1 root wheel 23K Oct 27 08:06 depcomp > -rwxr-xr-x 1 root wheel 15K Oct 27 08:06 install-sh > -rwxr-xr-x 1 root wheel 320K Oct 27 08:06 ltmain.sh > -rwxr-xr-x 1 root wheel 6.7K Oct 27 08:06 missing > -rw-r--r-- 1 root wheel 717K Oct 27 08:06 shell.c > -rw-r--r-- 1 root wheel 8.7K Oct 27 08:06 sqlite3.1 > -rw-r--r-- 1 root wheel 8.2M Oct 27 08:06 sqlite3.c > -rw-r--r-- 1 root wheel 599K Oct 27 08:06 sqlite3.h > -rw-r--r-- 1 root wheel 267B Oct 27 08:06 sqlite3.pc.in > -rw-r--r-- 1 root wheel 1.9K Oct 27 08:06 sqlite3.rc > -rw-r--r-- 1 root wheel 36K Oct 27 08:06 sqlite3ext.h > -rw-r--r-- 1 root wheel 78B Oct 27 08:06 sqlite3rc.h > drwxr-xr-x 6 root wheel 512B Oct 27 08:06 tea > > root@generic:/usr/src/contrib/sqlite3 # cc -DSQLITE_THREADSAFE=0 > -DSQLITE_OMIT_LOAD_EXTENSION shell.c sqlite3.c -o sqlite3 > > I've manually invoked the first compilation command inside the sqlite3 > source directory and it works just fine as seen below. > > root@generic:/usr/src/contrib/sqlite3 # cc -O2 -pipe -fno-common > -I/usr/src/contrib/sqlite3 -DSQLITE_THREADSAFE=0 > -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=zlib -MD -MF.depend.sqlite3.o > -MTsqlite3.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized > -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int > -Wno-unused-const-variable -Wno-error=unused-but-set-variable > -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality > -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef > -Wno-address-of-packed-member -Qunused-arguments -c > /usr/src/contrib/sqlite3/sqlite3.c -o sqlite3.o > > The second compilation command below seems to break even when compiled > manually. > > cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 -DSQLITE_THREADSAFE=1 > -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=zlib -std=gnu99 > -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror > -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable > -Wno-error=unused-but-set-variable -Wno-tautological-compare > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function > -Wno-enum-conversion -Wno-unused-local-typedef > -Wno-address-of-packed-member -Qunused-arguments -Wl,-zrelro -pie -o > sqlite3.full sqlite3.o -L/usr/obj/usr/src/arm64.aarch64/lib/libthr > -lpthread > ld: error: undefined symbol: main > >>> referenced by crt1_c.c:72 (/usr/src/lib/csu/aarch64/crt1_c.c:72) > >>> /usr/lib/Scrt1.o:(__start) > cc: error: linker command failed with exit code 1 (use -v to see > invocation) > *** Error code 1 > > Stop. > make: stopped in /usr/src/usr.bin/sqlite3 > > Just want to solicit if you have an idea of this particular problem or you > might have encountered this problem before? > > Thanks and best regards, > Archimedes > Hi Xin Li, Kindly ignore my query as it has been resolved as I've posted recently here https://lists.freebsd.org/archives/freebsd-current/2022-November/002905.html . Thanks and best regards, Archimedes > > > > > > > > >> >> > --0000000000000ff9f905ee621a92 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Nov 26, 2022 at 5:24 PM Archi= medes Gaviola <archimede= s.gaviola@gmail.com> wrote:


On Wed, Nov 16, 20= 22 at 10:06 AM Archimedes Gaviola <archimedes.gaviola@gmail.com> wrote:
<= div dir=3D"ltr">

On Wed, Nov 16, 2022 at 1:48 AM Xin LI <delphij@gmail.com> wrote:=


On Tue, Nov 15, 2022 at 5:16 AM Archimedes Gaviola <archimedes.gaviola@gmail.com= > wrote:
=
Hi,

There's an SQLite3 s= ource located in the=20 /usr/src/contrib/sqlite3. Is there a way to include this upon buildworld so= that I can run the binary after compiling?
<= /div>

Hi Xin Li,
=C2= =A0
Yes and no.

Yes -- you can always com= pile shell.c source and link against the library; the code is there, just t= he BSD make build glues are missing.
Okay, nice! I'm so glad that it can be done. My goal is to = make SQLite3 be part of the base system in a customized FreeBSD build to ma= ke it embedded. I am checking the version and it's updated 3.93.3 as I&= #39;m using the 14.0-CURRENT. I need to figure-out this BSD make and glues = you've mentioned to make this happen.

No -- the omission= is intentional: the library is meant to be used by the base system as a &q= uot;private library", which gives us the flexibility to not give a sta= ble API/ABI promise and to only build with options that the base system nee= ded (to reduce attack surface), so that when we make an update, it will be = a "wholesale" update and user applications are not broken, even i= f sqlite3 update have introduced one.=C2=A0 Users who want sqlite3 should r= eally install it from ports (databases/sqlite3) or package.

Oh I see, now I know its purpose. Curren= tly, I have my system installed with SQLite3 via package install 'pkg i= nstall sqlite3' and it works very well but because this time I want som= ething embeddable. It so happened that I was checking the source and surpri= singly found sqlite3. Anyway, let me explore and try.

<= div>Thanks and best regards,
Archimedes

Hi Xin LI,

I added the ne= w sqlite3 folder in the /usr/src/usr.bin/sqlite3 with the Makefile file as content and then reference the /usr/src/contrib/= sqlite3 directory as source.

root@generic:/usr= /src/usr.bin/sqlite3 # ls -la
total 16
drwxr-xr-x =C2=A0 =C2=A02 root= =C2=A0wheel =C2=A0 512 Nov 26 12:46 .
drwxr-xr-x =C2=A0279 root =C2=A0w= heel =C2=A05120 Nov 26 12:46 ..
-rw-r--r-- =C2=A0 =C2=A01 root =C2=A0whe= el =C2=A0 295 Nov 26 16:50 Makefile

root@generic:/usr/src/usr.bin/sq= lite3 # cat Makefile
# $FreeBSD$

.include <src.opts.mk>

SQLITE=3D ${SRCTOP= }/contrib/sqlite3
.PATH: =C2=A0${SQLITE}

PROG=3D sqlite3
MK_MA= N=3Dno
SRCS=3D sqlite3.c
INCS=3D shell.c sqlite3.h

WARNS?=3D 3=
CFLAGS+=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0-I${SQLITE} \
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -DSQLITE_THREADSAFE=3D0 \
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -DSQLITE_OMIT_LOAD_EXT= ENSION

.include <bsd.prog.mk>

and perform the 'make= ' command. However, I encountered this=20 error -> ld: error: undefined symbol: main as referenced to the crt1_c.c= :72 (/usr/src/lib/csu/aarch64/crt1_c.c:72) file.

<= div>root@generic:/usr/src/usr.bin/sqlite3 # make
cc =C2=A0-O2 -pipe -fno= -common -I/usr/src/contrib/sqlite3 =C2=A0-DSQLITE_THREADSAFE=3D1 =C2=A0-DSQ= LITE_OMIT_LOAD_EXTENSION =C2=A0 -fPIE -g -gz=3Dzlib -MD =C2=A0-MF.depend.sq= lite3.o -MTsqlite3.o -std=3Dgnu99 -Wno-format-zero-length -fstack-protector= -strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-param= eter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitia= lized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-co= nst-variable -Wno-error=3Dunused-but-set-variable -Wno-tautological-compare= -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum= -conversion -Wno-unused-local-typedef -Wno-address-of-packed-member =C2=A0-= Qunused-arguments =C2=A0 =C2=A0-c /usr/src/contrib/sqlite3/sqlite3.c -o sql= ite3.o
cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 -DSQLITE_THRE= ADSAFE=3D1 -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -std=3Dgnu99 -W= no-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wa= ll -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-p= rototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-b= ody -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=3Dunused-but= -set-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-= equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typede= f -Wno-address-of-packed-member -Qunused-arguments =C2=A0-Wl,-zrelro -pie = =C2=A0 -o sqlite3.full sqlite3.o =C2=A0-L/usr/obj/usr/src/arm64.aarch64/lib= /libthr -lpthread
ld: error: undefined symbol: main
>>> refe= renced by crt1_c.c:72 (/usr/src/lib/csu/aarch64/crt1_c.c:72)
>>>= ; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /usr/lib/Scrt1.o:(__star= t)
cc: error: linker command failed with exit code 1 (use -v to see invo= cation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.b= in/sqlite3

Not sure if I missed something or if so= mething goes wrong with my Makefile content construction. I basically follo= wed from here https://www.sqlite.org/howtocompile.html and then proved th= e source to compile successfully.

root@generic:/us= r/src/contrib/sqlite3 # pwd
/usr/src/contrib/sqlite3
root@generic:/us= r/src/contrib/sqlite3 # ls -lah
total 11364
drwxr-xr-x =C2=A0 3 root = =C2=A0wheel =C2=A0 1.0K Oct 27 08:06 .
drwxr-xr-x =C2=A089 root =C2=A0wh= eel =C2=A0 2.0K Nov 26 13:01 ..
-rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2= =A0 =C2=A015K Oct 27 08:06 INSTALL
-rw-r--r-- =C2=A0 1 root =C2=A0wheel = =C2=A0 729B Oct 27 08:06 Makefile.am
-rw-r--r-- =C2=A0 1 root =C2=A0whee= l =C2=A0 547B Oct 27 08:06 Makefile.fallback
-rw-r--r-- =C2=A0 1 root = =C2=A0wheel =C2=A0 =C2=A037K Oct 27 08:06 Makefile.in
-rw-r--r-- =C2=A0 = 1 root =C2=A0wheel =C2=A0 =C2=A028K Oct 27 08:06 Makefile.msc
-rw-r--r--= =C2=A0 1 root =C2=A0wheel =C2=A0 3.5K Oct 27 08:06 README.txt
-rw-r--r-= - =C2=A0 1 root =C2=A0wheel =C2=A0 7.1K Oct 27 08:06 Replace.cs
-rw-r--r= -- =C2=A0 1 root =C2=A0wheel =C2=A0 365K Oct 27 08:06 aclocal.m4
-rwxr-x= r-x =C2=A0 1 root =C2=A0wheel =C2=A0 7.2K Oct 27 08:06 compile
-rwxr-xr-= x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A048K Oct 27 08:06 config.guess
-= rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A035K Oct 27 08:06 config.su= b
-rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 485K Oct 27 08:06 configur= e
-rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 8.5K Oct 27 08:06 configure.ac
-rwxr-xr-x = =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A023K Oct 27 08:06 depcomp
-rwxr-xr= -x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A015K Oct 27 08:06 install-sh
-r= wxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 320K Oct 27 08:06 ltmain.sh
-r= wxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 6.7K Oct 27 08:06 missing
-rw-= r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 717K Oct 27 08:06 shell.c
-rw-r-= -r-- =C2=A0 1 root =C2=A0wheel =C2=A0 8.7K Oct 27 08:06 sqlite3.1
-rw-r-= -r-- =C2=A0 1 root =C2=A0wheel =C2=A0 8.2M Oct 27 08:06 sqlite3.c
-rw-r-= -r-- =C2=A0 1 root =C2=A0wheel =C2=A0 599K Oct 27 08:06 sqlite3.h
-rw-r-= -r-- =C2=A0 1 root =C2=A0wheel =C2=A0 267B Oct 27 08:06 sqlite3.pc.in
-rw-r--r-- =C2=A0 1 ro= ot =C2=A0wheel =C2=A0 1.9K Oct 27 08:06 sqlite3.rc
-rw-r--r-- =C2=A0 1 r= oot =C2=A0wheel =C2=A0 =C2=A036K Oct 27 08:06 sqlite3ext.h
-rw-r--r-- = =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A078B Oct 27 08:06 sqlite3rc.h
drwx= r-xr-x =C2=A0 6 root =C2=A0wheel =C2=A0 512B Oct 27 08:06 tea

root@generic:/usr/src/contrib/sqlite3 # cc -DSQLITE_THREADS= AFE=3D0 -DSQLITE_OMIT_LOAD_EXTENSION shell.c sqlite3.c -o sqlite3

I've manually invoked the first compilation command ins= ide the sqlite3 source directory and it works just fine as seen below.
<= /div>

root@generic:/usr/src/contrib/sqlite3 # cc =C2=A0-= O2 -pipe -fno-common =C2=A0 -I/usr/src/contrib/sqlite3 =C2=A0-DSQLITE_THREA= DSAFE=3D0 =C2=A0-DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -MD =C2=A0= -MF.depend.sqlite3.o -MTsqlite3.o -std=3Dgnu99 -Wno-format-zero-length -fst= ack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno= -unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith = -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -= Wno-unused-const-variable -Wno-error=3Dunused-but-set-variable -Wno-tautolo= gical-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-funct= ion -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-m= ember =C2=A0-Qunused-arguments -c /usr/src/contrib/sqlite3/sqlite3.c -o sql= ite3.o

The second compilation command below seems = to break even when compiled manually.

cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3=20 -DSQLITE_THREADSAFE=3D1 -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib=20 -std=3Dgnu99 -Wno-format-zero-length -fstack-protector-strong=20 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter=20 -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith=20 -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body=20 -Wno-string-plus-int -Wno-unused-const-variable=20 -Wno-error=3Dunused-but-set-variable -Wno-tautological-compare=20 -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function=20 -Wno-enum-conversion -Wno-unused-local-typedef=20 -Wno-address-of-packed-member -Qunused-arguments =C2=A0-Wl,-zrelro -pie =C2= =A0 -o=20 sqlite3.full sqlite3.o =C2=A0-L/usr/obj/usr/src/arm64.aarch64/lib/libthr=20 -lpthread
ld: error: undefined symbol: main
>>> referenced b= y crt1_c.c:72 (/usr/src/lib/csu/aarch64/crt1_c.c:72)
>>> =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /usr/lib/Scrt1.o:(__start)
cc= : error: linker command failed with exit code 1 (use -v to see invocation)<= br>*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/sqlit= e3

Just want to solicit if you have an idea o= f this particular problem or you might have encountered this problem before= ?

Thanks and best regards,
Archimedes

Hi Xin Li,
Kindly ignore my query as it has been resolved as I've pos= ted recently here https://lists.freebsd.org/archives/freebsd-= current/2022-November/002905.html.

Thanks = and best regards,
Archimedes
=C2=A0




=


=C2=A0
=C2=A0
--0000000000000ff9f905ee621a92--