From nobody Sat Nov 26 16:20:43 2022 X-Original-To: freebsd-current@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 4NKHFk5sm1z4hW7G for ; Sat, 26 Nov 2022 16:27:38 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) (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 4NKHFk3lpQz40L1 for ; Sat, 26 Nov 2022 16:27:38 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ua1-x936.google.com with SMTP id 97so2496141uam.0 for ; Sat, 26 Nov 2022 08:27:38 -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=6tH1JngrO9ti+QPKE6klE74+QSOxgnordVh01NDEEQg=; b=QdCsXAOGbNPKnYZ7WsxW79+xqAJ/0rcs2LhH6OMbO48j+Wn76zSlFSZ7RdrQsC9TpF GXJx/xsXW9f/hBzzpuNdMQ0IstCjHLOQRwK0gltc6YlVWIoAfCRDT9oFRGzDElv7XEGr AvnBkITPK63JBrG0i0zevOakJmzXBwh1kOwObf7feiUgbW2zrFIerYS+rWRbcEiG3VCr JFuq5cN4To2elifCI5mHBc/ZheZ5ovtsOiAP42sDv2JTqJ4dR+WNUBu808yiHr5StQp9 DR+uFCXQIZOCQjgW9OtGFHieogfyxealrLdCpdUDKrnCLS7Fv4k9b5BKWhtrmjFSsFCj 9e7g== 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=6tH1JngrO9ti+QPKE6klE74+QSOxgnordVh01NDEEQg=; b=5f+pp74l4KoXJaqcM+x1lSmitGbgVx2tbhVAAEPVB/k2+NbuX2SKBaJu6g1CTR39fG 2c657Qmw0Jg1nyzNWhD1B0ew2HFkCDvTWxx6xTcE/8hvlGDvHH8dBozDCcdf/gvEu2Eq BbL4PnaDNOlhYZ1EwVMhhZAfZJoILO4FoEI0OqCDHZ0agsTEXzfst66B7mXmptpPAU6n brZVdBwH0Fz6i5sjj0ctktXa9dIJkYNNyUkniq5lhxpkzwJCMxMFlJE8UWB7sWv5S1v5 B606bS02lT5fy5UR1cXM4fSEc9sCgF5y90dRJtO4vJ4BBm3hqJoQgupIkQA7Pl7pkn7W +xkw== X-Gm-Message-State: ANoB5pmb4Dlo9ZEYNZOUXKNjlZgVksXOMyYl7aR/0ADBsmqIW12LSKjh syQJ7c5vrf6QRc65jfb8UXNCzYMt2TYM4RpNpNv8iFn1 X-Google-Smtp-Source: AA0mqf5gMvMKcff6Eako0OA4S3ve2iUSL9FH5lh/w4iXdJVkmUftUzfUasny1Uj0e1caH+K3QHK1B3Ui9MsXNtOqxe0= X-Received: by 2002:a5b:54f:0:b0:6e5:92af:572e with SMTP id r15-20020a5b054f000000b006e592af572emr39101129ybp.227.1669479638162; Sat, 26 Nov 2022 08:20:38 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: <33b789dd-d501-e57b-0817-a8f533f337a5@aetern.org> In-Reply-To: <33b789dd-d501-e57b-0817-a8f533f337a5@aetern.org> From: Archimedes Gaviola Date: Sun, 27 Nov 2022 00:20:43 +0800 Message-ID: Subject: Re: ld error (undefined symbol) while compiling sqlite3 To: Yuri Cc: freebsd-current Content-Type: multipart/alternative; boundary="000000000000cae18805ee6204b7" X-Rspamd-Queue-Id: 4NKHFk3lpQz40L1 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000cae18805ee6204b7 Content-Type: text/plain; charset="UTF-8" On Sat, Nov 26, 2022 at 11:53 PM Yuri 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 > > > > 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 > > > > 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 > > 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 > > > > 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


=
On Sat, Nov 26, 2022 at 11:53 PM Yuri= <yuri@aetern.org> wrote:
<= /div>
Archimedes Gaviola w= rote:
> 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<= br> > created a /usr/src/usr.bin/sqlite3 directory and created a Makefile fi= le
> with content referred to the 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=A0wheel =C2=A05120 Nov 26 12:46 ..
> -rw-r--r-- =C2=A0 =C2=A01 root =C2=A0wheel =C2=A0 295 Nov 26 16:50 Mak= efile
>
> root@generic:/usr/src/usr.bin/sqlite3 # cat Makefile
> # $FreeBSD$
>
> .include <src.opts.mk>
>
> SQLITE=3D ${SRCTOP}/contrib/sqlite3
> .PATH: =C2=A0${SQLITE}
>
> PROG=3D sqlite3
> MK_MAN=3Dno
> SRCS=3D sqlite3.c

SRCS=3D shell.c sqlite3.c

> INCS=3D shell.c sqlite3.h

Remove?

>
> WARNS?=3D 3

WARNS?=3D 2 worked for me.

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

> 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_THREA= DSAFE=3D0 \
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -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 =C2=A0-O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 =C2=A0-DSQLI= TE_THREADSAFE=3D1
> =C2=A0-DSQLITE_OMIT_LOAD_EXTENSION =C2=A0 -fPIE -g -gz=3Dzlib -MD =C2= =A0-MF.depend.sqlite3.o
> -MTsqlite3.o -std=3Dgnu99 -Wno-format-zero-length -fstack-protector-st= rong
> -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete= r
> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitia= lized
> -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int
> -Wno-unused-const-variable -Wno-error=3Dunused-but-set-variable
> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality<= br> > -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 sqlite3.o
> cc -O2 -pipe -fno-common -I/usr/src/contrib/sqlite3 -DSQLITE_THREADSAF= E=3D1
> -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -std=3Dgnu99
> -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Wer= ror
> -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-s= ign
> -Wno-empty-body -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-typedef
> -Wno-address-of-packed-member -Qunused-arguments =C2=A0-Wl,-zrelro -pi= e =C2=A0 -o
> sqlite3.full sqlite3.o =C2=A0-L/usr/obj/usr/src/arm64.aarch64/lib/libt= hr
> -lpthread
> ld: error: undefined symbol: main
>>>> referenced 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:(__start)
> cc: error: linker command failed with exit code 1 (use -v to see invoc= ation)
> *** 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 Make= file
> content construction. I basically followed here
> https://www.sqlite.org/howtocompile.html
> <https://www.sqlite.org/howtocompile.html> an= d 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 =C2=A0 3 root =C2=A0wheel =C2=A0 1.0K Oct 27 08:06 .
> drwxr-xr-x =C2=A089 root =C2=A0wheel =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 INS= TALL
> -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=A0wheel =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 Mak= efile.in
> -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A028K Oct 27 08:06 Mak= efile.msc
> -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 3.5K Oct 27 08:06 README.t= xt
> -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-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 7.2K Oct 27 08:06 compile<= br> > -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A048K Oct 27 08:06 con= fig.guess
> -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A035K Oct 27 08:06 con= fig.sub
> -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<= /a>
> <
http://configure.ac>
> -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A023K Oct 27 08:06 dep= comp
> -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A015K Oct 27 08:06 ins= tall-sh
> -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 320K Oct 27 08:06 ltmain.s= h
> -rwxr-xr-x =C2=A0 1 root =C2=A0wheel =C2=A0 6.7K Oct 27 08:06 missing<= br> > -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 717K Oct 27 08:06 shell.c<= br> > -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.i= n
> <http://sqlite3.pc.in>
> -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 1.9K Oct 27 08:06 sqlite3.= rc
> -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A036K Oct 27 08:06 sql= ite3ext.h
> -rw-r--r-- =C2=A0 1 root =C2=A0wheel =C2=A0 =C2=A078B Oct 27 08:06 sql= ite3rc.h
> drwxr-xr-x =C2=A0 6 root =C2=A0wheel =C2=A0 512B Oct 27 08:06 tea
>
> root@generic:/usr/src/contrib/sqlite3 # cc -DSQLITE_THREADSAFE=3D0
> -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 =C2=A0-O2 -pipe -fno-common=
> -I/usr/src/contrib/sqlite3 =C2=A0-DSQLITE_THREADSAFE=3D0
> =C2=A0-DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -MD =C2=A0-MF.d= epend.sqlite3.o
> -MTsqlite3.o -std=3Dgnu99 -Wno-format-zero-length -fstack-protector-st= rong
> -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete= r
> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitia= lized
> -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int
> -Wno-unused-const-variable -Wno-error=3Dunused-but-set-variable
> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality<= br> > -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef > -Wno-address-of-packed-member =C2=A0-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_THREADSAF= E=3D1
> -DSQLITE_OMIT_LOAD_EXTENSION -fPIE -g -gz=3Dzlib -std=3Dgnu99
> -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Wer= ror
> -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-s= ign
> -Wno-empty-body -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-typedef
> -Wno-address-of-packed-member -Qunused-arguments =C2=A0-Wl,-zrelro -pi= e =C2=A0 -o
> sqlite3.full sqlite3.o =C2=A0-L/usr/obj/usr/src/arm64.aarch64/lib/libt= hr
> -lpthread
> ld: error: undefined symbol: main
>>>> referenced 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:(__start)
> cc: error: linker command failed with exit code 1 (use -v to see invoc= ation)
> *** 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 s= o,
> I share it here.
>
> Thanks and best regards,
> Archimedes
>
>
>
>
>
>

--000000000000cae18805ee6204b7--