Bug 290833 - databases/sqlite3:build fails-ldd:...stage/usr/local/bin/sqlite3: Exec format error
Summary: databases/sqlite3:build fails-ldd:...stage/usr/local/bin/sqlite3: Exec format...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: riscv Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-06 13:57 UTC by rdunkle
Modified: 2025-11-11 18:16 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (pavelivolkov)


Attachments
build log (8.50 KB, application/x-compressed)
2025-11-06 13:57 UTC, rdunkle
no flags Details
build log sqlite3-3.50.4_1,1 (4.40 KB, application/x-compressed)
2025-11-08 07:19 UTC, rdunkle
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rdunkle 2025-11-06 13:57:27 UTC
Created attachment 265206 [details]
build log

riscv 16.0-CURRENT FreeBSD 16.0-CURRENT #0 main-n281643-c3a3af134668
build fails near end--
/usr/bin/env LD_LIBMAP_DISABLE=1 ldd -a "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3" "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/lib/libsqlite3.so"
ldd: /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: Exec format error
/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: exit status 1
/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/lib/libsqlite3.so: exit status 1
build log attached
Comment 1 Matthias Andree freebsd_committer freebsd_triage 2025-11-07 17:31:13 UTC
Not a relevant platform. If you need this fixed, please provide a patch.
Comment 2 Jessica Clarke freebsd_committer freebsd_triage 2025-11-07 18:03:01 UTC
Sorry, what do you mean "not a relevant platform"? You can de-prioritise it as not something you want to spend your time working on, but it is an architecture supported by FreeBSD and so this is a legitimate bug report, not one that should just be closed because you personally don't care.
Comment 3 rdunkle 2025-11-08 06:35:48 UTC
sqlite3-3.50.2_1,1  built in the past:
pkg info -f sqlite3-3.50.2_1,1
sqlite3-3.50.2_1,1
Name           : sqlite3
Version        : 3.50.2_1,1
Installed on   : Tue Sep 30 16:09:05 2025 EEST
Origin         : databases/sqlite3
Architecture   : FreeBSD:16:riscv64
Prefix         : /usr/local
Categories     : databases
Licenses       : PD
Maintainer     : pavelivolkov@gmail.com
WWW            : https://www.sqlite.org/
Comment        : SQL database engine in a C library
Options        :
        ARMOR          : off
        DBPAGE         : on
        DBSTAT         : on
        DIRECT_READ    : on
        DQS            : off
        EXAMPLES       : on
        EXTENSION      : on
        FTS3_TOKEN     : on
        FTS4           : on
        FTS5           : on
        GEOPOLY        : off
        ICU            : off
        LIBEDIT        : on
        LIKENOTBLOB    : off
        MEMMAN         : off
        METADATA       : on
        NORMALIZE      : off
        NULL_TRIM      : off
        OFFSET         : off
        RBU            : off
        READLINE       : off
        RTREE          : on
        RTREE_INT      : off
        SECURE_DELETE  : on
        SESSION        : off
        SORT_REF       : off
        SOUNDEX        : off
        STAT3          : off
        STAT4          : off
        STATIC         : off
        STMT           : off
        STRIP          : on
        TCL            : off
        THREADS        : on
        TRUSTED_SCHEMA : off
        TS0            : off
        TS1            : on
        TS2            : off
        TS3            : off
        UNICODE61      : on
        UNKNOWN_SQL    : off
        UNLOCK_NOTIFY  : on
        UPDATE_LIMIT   : off
        URI            : on
        URI_AUTHORITY  : off
Shared Libs required:
        libc.so.7
        libedit.so.8
        libm.so.5
        libncursesw.so.9
        libthr.so.3
        libz.so.6
Shared Libs provided:
        libsqlite3.so.0
Annotations    :
        FreeBSD_version: 1600000
        build_timestamp: 2025-09-27T13:11:15+00:00
        built_by       : poudriere-git-3.4.99.20250724
        flavor         : default
        port_checkout_unclean: no
        port_git_hash  : 17468749f972
        ports_top_checkout_unclean: no
        ports_top_git_hash: 3b6728a8303d
        repo_type      : binary
        repository     : riscv
Flat size      : 4.81MiB
Comment 4 rdunkle 2025-11-08 06:37:59 UTC
but that was sqlite3
Comment 5 rdunkle 2025-11-08 07:19:08 UTC
Created attachment 265262 [details]
build log sqlite3-3.50.4_1,1
Comment 6 rdunkle 2025-11-08 07:34:28 UTC
Not sure if this is significant.
During boot on the serial console (but not in captured in the /var/log/messages)
I see this:
Mounting local filesystems:.
ELF binary type "0" not known.
eval: /libexec/ld-elf.so.1: Exec format error
ELF ldconfig path: /usr/lib/compat /usr/local/lib /usr/local/lib/heimdal /usr/local/lib/mysql /usr/local/lib/perl5/5.42/mach/CORE /usr/local/lib/qt5 /usr/local/llvm19/lib /usr/local/llvm19/lib/riscv64-portbld-freebsd16.0
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2025-11-11 10:31:00 UTC
The problem is that that the linker is directly called to do a link instead of going through the C compiler.  On some platforms, just invoking the linker directly does not add the required flags to make the link work.

It may be enough to call brandelf on the resulting binary to fix this issue.