Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Nov 2022 00:20:43 +0800
From:      Archimedes Gaviola <archimedes.gaviola@gmail.com>
To:        Yuri <yuri@aetern.org>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: ld error (undefined symbol) while compiling sqlite3
Message-ID:  <CAJFbk7H5yWnxTb7LRE%2BSmGnmsZq=4f2%2BVcH9Yb1kdcQHS=B58w@mail.gmail.com>
In-Reply-To: <33b789dd-d501-e57b-0817-a8f533f337a5@aetern.org>
References:  <CAJFbk7HSVXNTdeq14ExCT5TkQp5a%2BFu686_EUQER62ENVupPdA@mail.gmail.com> <33b789dd-d501-e57b-0817-a8f533f337a5@aetern.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000cae18805ee6204b7
Content-Type: text/plain; charset="UTF-8"

On Sat, Nov 26, 2022 at 11:53 PM Yuri <yuri@aetern.org> wrote:

> Archimedes Gaviola wrote:
> > Hi,
> >
> > For some reason, I am compiling sqlite3 from the
> > /usr/src/contrib/sqlite3 source using
> > FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20221027-769b884e2e2-258837. I
> > created a /usr/src/usr.bin/sqlite3 directory and created a Makefile file
> > with content referred to the 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 <src.opts.mk>
> >
> > SQLITE= ${SRCTOP}/contrib/sqlite3
> > .PATH:  ${SQLITE}
> >
> > PROG= sqlite3
> > MK_MAN=no
> > SRCS= sqlite3.c
>
> SRCS= shell.c sqlite3.c
>
> > INCS= shell.c sqlite3.h
>
> Remove?
>
> >
> > WARNS?= 3
>
> WARNS?= 2 worked for me.
>

Awesome! It works now. Thanks a lot for figuring-out Yuri!


>
> > CFLAGS+=        -I${SQLITE} \
> >                 -DSQLITE_THREADSAFE=0 \
> >                 -DSQLITE_OMIT_LOAD_EXTENSION
> >
> > .include <bsd.prog.mk>
> >
> > With 'make' command invoked, 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. See below details for the
> > actual error.
> >
> > 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 here
> > https://www.sqlite.org/howtocompile.html
> > <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
> > <http://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
> > <http://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
> >
> > So, the above compilation builds the source successfully.
> >
> > This time I've manually invoked the first compilation command 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
> >
> > While the second compilation command below breaks having the same
> > manifested error.
> >
> > 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
> >
> > Any idea of this problem? I posted this at freebsd-database ML however,
> > I'm thinking that the problem might not be related to SQLite3
> > perspective as I have compiled the source without any problem at all so,
> > I share it here.
> >
> > Thanks and best regards,
> > Archimedes
> >
> >
> >
> >
> >
> >
>
>

--000000000000cae18805ee6204b7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, Nov 26, 2022 at 11:53 PM Yuri=
 &lt;<a href=3D"mailto:yuri@aetern.org">yuri@aetern.org</a>&gt; wrote:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">Archimedes Gaviola w=
rote:<br>
&gt; Hi,<br>
&gt; <br>
&gt; For some reason, I am compiling sqlite3 from the<br>
&gt; /usr/src/contrib/sqlite3 source using<br>
&gt; FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20221027-769b884e2e2-258837. I<=
br>
&gt; created a /usr/src/usr.bin/sqlite3 directory and created a Makefile fi=
le<br>
&gt; with content referred to the source.<br>
&gt; <br>
&gt; root@generic:/usr/src/usr.bin/sqlite3 # ls -la<br>
&gt; total 16<br>
&gt; drwxr-xr-x =C2=A0 =C2=A02 root =C2=A0wheel =C2=A0 512 Nov 26 12:46 .<b=
r>
&gt; drwxr-xr-x =C2=A0279 root =C2=A0wheel =C2=A05120 Nov 26 12:46 ..<br>
&gt; -rw-r--r-- =C2=A0 =C2=A01 root =C2=A0wheel =C2=A0 295 Nov 26 16:50 Mak=
efile<br>
&gt; <br>
&gt; root@generic:/usr/src/usr.bin/sqlite3 # cat Makefile<br>
&gt; # $FreeBSD$<br>
&gt; <br>
&gt; .include &lt;<a href=3D"http://src.opts.mk" rel=3D"noreferrer" target=
=3D"_blank">src.opts.mk</a>&gt;<br>
&gt; <br>
&gt; SQLITE=3D ${SRCTOP}/contrib/sqlite3<br>
&gt; .PATH: =C2=A0${SQLITE}<br>
&gt; <br>
&gt; PROG=3D sqlite3<br>
&gt; MK_MAN=3Dno<br>
&gt; SRCS=3D sqlite3.c<br>
<br>
SRCS=3D shell.c sqlite3.c<br>
<br>
&gt; INCS=3D shell.c sqlite3.h<br>
<br>
Remove?<br>
<br>
&gt; <br>
&gt; WARNS?=3D 3<br>
<br>
WARNS?=3D 2 worked for me.<br></blockquote><div><br></div><div>Awesome! It =
works now. Thanks a lot for figuring-out Yuri!</div><div>=C2=A0<br></div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le=
ft:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt; CFLAGS+=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0-I${SQLITE} \<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -DSQLITE_THREA=
DSAFE=3D0 \<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -DSQLITE_OMIT_=
LOAD_EXTENSION<br>
&gt; <br>
&gt; .include &lt;<a href=3D"http://bsd.prog.mk" rel=3D"noreferrer" target=
=3D"_blank">bsd.prog.mk</a>&gt;<br>
&gt; <br>
&gt; With &#39;make&#39; command invoked, I encountered this error -&gt; ld=
: error:<br>
&gt; undefined symbol: main as referenced to the crt1_c.c:72<br>
&gt; (/usr/src/lib/csu/aarch64/crt1_c.c:72) file. See below details for the=
<br>
&gt; actual error.<br>
&gt; <br>
&gt; root@generic:/usr/src/usr.bin/sqlite3 # make<br>
&gt; cc =C2=A0-O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 =C2=A0-DSQLI=
TE_THREADSAFE=3D1<br>
&gt; =C2=A0-DSQLITE_OMIT_LOAD_EXTENSION =C2=A0 -fPIE -g -gz=3Dzlib -MD =C2=
=A0-MF.depend.sqlite3.o<br>
&gt; -MTsqlite3.o -std=3Dgnu99 -Wno-format-zero-length -fstack-protector-st=
rong<br>
&gt; -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete=
r<br>
&gt; -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitia=
lized<br>
&gt; -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int<br>
&gt; -Wno-unused-const-variable -Wno-error=3Dunused-but-set-variable<br>
&gt; -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality<=
br>
&gt; -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef<br=
>
&gt; -Wno-address-of-packed-member =C2=A0-Qunused-arguments =C2=A0 =C2=A0-c=
<br>
&gt; /usr/src/contrib/sqlite3/sqlite3.c -o sqlite3.o<br>
&gt; cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 -DSQLITE_THREADSAF=
E=3D1<br>
&gt; -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -std=3Dgnu99<br>
&gt; -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Wer=
ror<br>
&gt; -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes<br>
&gt; -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-s=
ign<br>
&gt; -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable<br>
&gt; -Wno-error=3Dunused-but-set-variable -Wno-tautological-compare<br>
&gt; -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function<br>
&gt; -Wno-enum-conversion -Wno-unused-local-typedef<br>
&gt; -Wno-address-of-packed-member -Qunused-arguments =C2=A0-Wl,-zrelro -pi=
e =C2=A0 -o<br>
&gt; sqlite3.full sqlite3.o =C2=A0-L/usr/obj/usr/src/arm64.aarch64/lib/libt=
hr<br>
&gt; -lpthread<br>
&gt; ld: error: undefined symbol: main<br>
&gt;&gt;&gt;&gt; referenced by crt1_c.c:72 (/usr/src/lib/csu/aarch64/crt1_c=
.c:72)<br>
&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /usr/lib/=
Scrt1.o:(__start)<br>
&gt; cc: error: linker command failed with exit code 1 (use -v to see invoc=
ation)<br>
&gt; *** Error code 1<br>
&gt; <br>
&gt; Stop.<br>
&gt; make: stopped in /usr/src/usr.bin/sqlite3<br>
&gt; <br>
&gt; Not sure if I missed something or if something goes wrong with my Make=
file<br>
&gt; content construction. I basically followed here<br>
&gt; <a href=3D"https://www.sqlite.org/howtocompile.html" rel=3D"noreferrer=
" target=3D"_blank">https://www.sqlite.org/howtocompile.html</a><br>;
&gt; &lt;<a href=3D"https://www.sqlite.org/howtocompile.html" rel=3D"norefe=
rrer" target=3D"_blank">https://www.sqlite.org/howtocompile.html</a>&gt; an=
d then proved the source to<br>
&gt; compile successfully.<br>
&gt; <br>
&gt; root@generic:/usr/src/contrib/sqlite3 # pwd<br>
&gt; /usr/src/contrib/sqlite3<br>
&gt; root@generic:/usr/src/contrib/sqlite3 # ls -lah<br>
&gt; total 11364<br>
&gt; drwxr-xr-x =C2=A0 3 root =C2=A0wheel =C2=A0 1.0K Oct 27 08:06 .<br>
&gt; drwxr-xr-x =C2=A089 root =C2=A0wheel =C2=A0 2.0K Nov 26 13:01 ..<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A015K Oct 27 08:06 INS=
TALL<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 729B Oct 27 08:06 Makefile=
.am<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 547B Oct 27 08:06 Makefile=
.fallback<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A037K Oct 27 08:06 Mak=
efile.in<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A028K Oct 27 08:06 Mak=
efile.msc<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 3.5K Oct 27 08:06 README.t=
xt<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 7.1K Oct 27 08:06 Replace.=
cs<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 365K Oct 27 08:06 aclocal.=
m4<br>
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 7.2K Oct 27 08:06 compile<=
br>
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A048K Oct 27 08:06 con=
fig.guess<br>
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A035K Oct 27 08:06 con=
fig.sub<br>
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 485K Oct 27 08:06 configur=
e<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 8.5K Oct 27 08:06 <a href=
=3D"http://configure.ac" rel=3D"noreferrer" target=3D"_blank">configure.ac<=
/a><br>
&gt; &lt;<a href=3D"http://configure.ac" rel=3D"noreferrer" target=3D"_blan=
k">http://configure.ac</a>&gt;<br>;
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A023K Oct 27 08:06 dep=
comp<br>
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A015K Oct 27 08:06 ins=
tall-sh<br>
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 320K Oct 27 08:06 ltmain.s=
h<br>
&gt; -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 6.7K Oct 27 08:06 missing<=
br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 717K Oct 27 08:06 shell.c<=
br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 8.7K Oct 27 08:06 sqlite3.=
1<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 8.2M Oct 27 08:06 sqlite3.=
c<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 599K Oct 27 08:06 sqlite3.=
h<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 267B Oct 27 08:06 <a href=
=3D"http://sqlite3.pc.in" rel=3D"noreferrer" target=3D"_blank">sqlite3.pc.i=
n</a><br>
&gt; &lt;<a href=3D"http://sqlite3.pc.in" rel=3D"noreferrer" target=3D"_bla=
nk">http://sqlite3.pc.in</a>&gt;<br>;
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 1.9K Oct 27 08:06 sqlite3.=
rc<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A036K Oct 27 08:06 sql=
ite3ext.h<br>
&gt; -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A078B Oct 27 08:06 sql=
ite3rc.h<br>
&gt; drwxr-xr-x =C2=A0 6 root =C2=A0wheel =C2=A0 512B Oct 27 08:06 tea<br>
&gt; <br>
&gt; root@generic:/usr/src/contrib/sqlite3 # cc -DSQLITE_THREADSAFE=3D0<br>
&gt; -DSQLITE_OMIT_LOAD_EXTENSION shell.c sqlite3.c -o sqlite3<br>
&gt; <br>
&gt; So, the above compilation builds the source successfully.<br>
&gt; <br>
&gt; This time I&#39;ve manually invoked the first compilation command and =
it<br>
&gt; works just fine as seen below.<br>
&gt; <br>
&gt; root@generic:/usr/src/contrib/sqlite3 # cc =C2=A0-O2 -pipe -fno-common=
<br>
&gt; -I/usr/src/contrib/sqlite3 =C2=A0-DSQLITE_THREADSAFE=3D0<br>
&gt; =C2=A0-DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -MD =C2=A0-MF.d=
epend.sqlite3.o<br>
&gt; -MTsqlite3.o -std=3Dgnu99 -Wno-format-zero-length -fstack-protector-st=
rong<br>
&gt; -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete=
r<br>
&gt; -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitia=
lized<br>
&gt; -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int<br>
&gt; -Wno-unused-const-variable -Wno-error=3Dunused-but-set-variable<br>
&gt; -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality<=
br>
&gt; -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef<br=
>
&gt; -Wno-address-of-packed-member =C2=A0-Qunused-arguments -c<br>
&gt; /usr/src/contrib/sqlite3/sqlite3.c -o sqlite3.o<br>
&gt; <br>
&gt; While the second compilation command below breaks having the same<br>
&gt; manifested error.<br>
&gt; <br>
&gt; cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 -DSQLITE_THREADSAF=
E=3D1<br>
&gt; -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -std=3Dgnu99<br>
&gt; -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Wer=
ror<br>
&gt; -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes<br>
&gt; -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-s=
ign<br>
&gt; -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable<br>
&gt; -Wno-error=3Dunused-but-set-variable -Wno-tautological-compare<br>
&gt; -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function<br>
&gt; -Wno-enum-conversion -Wno-unused-local-typedef<br>
&gt; -Wno-address-of-packed-member -Qunused-arguments =C2=A0-Wl,-zrelro -pi=
e =C2=A0 -o<br>
&gt; sqlite3.full sqlite3.o =C2=A0-L/usr/obj/usr/src/arm64.aarch64/lib/libt=
hr<br>
&gt; -lpthread<br>
&gt; ld: error: undefined symbol: main<br>
&gt;&gt;&gt;&gt; referenced by crt1_c.c:72 (/usr/src/lib/csu/aarch64/crt1_c=
.c:72)<br>
&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /usr/lib/=
Scrt1.o:(__start)<br>
&gt; cc: error: linker command failed with exit code 1 (use -v to see invoc=
ation)<br>
&gt; *** Error code 1<br>
&gt; <br>
&gt; Stop.<br>
&gt; make: stopped in /usr/src/usr.bin/sqlite3<br>
&gt; <br>
&gt; Any idea of this problem? I posted this at freebsd-database ML however=
,<br>
&gt; I&#39;m thinking that the problem might not be related to SQLite3<br>
&gt; perspective as I have compiled the source without any problem at all s=
o,<br>
&gt; I share it here.<br>
&gt; <br>
&gt; Thanks and best regards,<br>
&gt; Archimedes<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
<br>
</blockquote></div></div>

--000000000000cae18805ee6204b7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJFbk7H5yWnxTb7LRE%2BSmGnmsZq=4f2%2BVcH9Yb1kdcQHS=B58w>