by darksky » Mon Dec 30, 2024 8:36 pm
"I don't know much about compiler/linker settings on ARM. But how is it possible that there is a built package in the repo, but the PKGBUILD from git does not build?"
I highly suspect you have fallen victim to having the latest /etc/makepkg.conf. It actually has been that way for a while. Maybe you have a newer install or have edited /etc/makepkg.conf with the latest changes from the .pacnew file after a pacman upgrade. I have to make some changes in a few PKGBUILD's here. Kodi being one of them to name one.
I compiled mariadb today and got the same as you with the errors and then add these last 2 lines unsetting and redefining the LDFLAGS here in the PKGBUILD and it compiled ok.
```
# this uses malloc_usable_size, which is incompatible with fortification level 3
export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
unset LDFLAGS
LDFLAGS+="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now"
```
Build log snippet:
```
[ 97%] Building CXX object sql/CMakeFiles/sql.dir/semisync_master.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/semisync_slave.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/semisync_master_ack_receiver.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sp_instr.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_schema.cc.o
Creating mysqltest_embedded link
Creating mysql_client_test_embedded link
[ 98%] Built target mariadb-test-embedded
[ 98%] Built target mariadb-client-test-embedded
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/lex_charset.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/charset_collations.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_type.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_mode.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_type_json.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_type_string.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_type_geom.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/item_windowfunc.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_window.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_cte.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/item_vers.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_sequence.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/sql_tvc.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/opt_split.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/rowid_filter.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/opt_trace.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/table_cache.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/encryption.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/temporary_tables.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/json_table.cc.o
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/proxy_protocol.cc.o
[ 99%] Building CXX object sql/CMakeFiles/sql.dir/backup.cc.o
[ 99%] Building CXX object sql/CMakeFiles/sql.dir/xa.cc.o
[ 99%] Building C object sql/CMakeFiles/sql.dir/socketpair.c.o
[ 99%] Building CXX object sql/CMakeFiles/sql.dir/threadpool_generic.cc.o
[ 99%] Building CXX object sql/CMakeFiles/sql.dir/threadpool_common.cc.o
[ 99%] Linking CXX static library libsql.a
[ 99%] Built target sql
[ 99%] Building CXX object sql/CMakeFiles/mariadbd.dir/main.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/xtrabackup.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/datasink.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/innobackupex.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/ds_buffer.cc.o
[ 99%] Linking CXX executable mariadbd
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/ds_compress.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/ds_local.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/ds_stdout.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/ds_tmpfile.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/ds_xbstream.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/fil_cur.cc.o
[ 99%] Building C object extra/mariabackup/CMakeFiles/mariadb-backup.dir/quicklz/quicklz.c.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/read_filt.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/write_filt.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/wsrep.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/xbstream_write.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/backup_mysql.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/backup_copy.cc.o
[ 99%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/encryption_plugin.cc.o
[100%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/__/__/sql/sql_builtin.cc.o
[100%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/aria_backup_client.cc.o
[100%] Building CXX object extra/mariabackup/CMakeFiles/mariadb-backup.dir/thread_pool.cc.o
Creating mysqld link
[100%] Built target mariadbd
...
...
==> Leaving fakeroot environment.
==> Finished making: mariadb 11.6.2-2 (Mon 30 Dec 2024 02:15:03 PM CST)
real 47m12.847s
user 14m10.651s
sys 3m1.676s
```