mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/13] Remove dependency on ld --gc-section in PBL
@ 2024-10-16  9:01 Ahmad Fatoum
  2024-10-16  9:01 ` [PATCH 01/13] kconfig: add IS_PROPER helper Ahmad Fatoum
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Ahmad Fatoum @ 2024-10-16  9:01 UTC (permalink / raw)
  To: barebox

We depend on -ffunction-sections -fdata-sections at a lot of places and
fail the link without due to undefined references. This is especially
needed for obj-pbl-y code as the files usually have other functions
depending on barebox proper infrastructure, but that is never called.

This works so far, but breaks for two things: LTO and using PBL on
sandbox. Both I have not managed to get the linker not to complain about
the undefined references in the ultimately unreferenced code.

Therefore, let's solve this a different way: Adjust the relevant headers
to define stubs when built for sandbox.

This has the nice side effect of compile testing the stubs during PBL
build, so forgotten semicolons are more likely to be noticed during
development instead of CI run.


Ahmad Fatoum (13):
  kconfig: add IS_PROPER helper
  lib: random: add stubs for PBL
  bootsource: stub out when in PBL
  crypto: provide crypto_memneq for PBL
  cdev: stub out cdev_read/write for PBL
  libfile: stub out file descriptor API for PBL
  environment: stub out environment API for PBL
  of: stub out live tree API when using PBL
  errno: stub out perror/strerror API when built for PBL
  xfuncs: stub out API when built for PBL
  stdio: stub out basprintf and friends when built for PBL
  memory: stub out request_barebox_region for PBL
  malloc: add PBL stubs

 common/bootsource.c     |  2 +-
 crypto/Makefile         |  2 +-
 include/driver.h        | 24 ++++++++++++--
 include/environment.h   |  2 +-
 include/errno.h         | 10 ++++++
 include/fcntl.h         |  8 +++++
 include/libfile.h       |  7 ++++
 include/linux/kconfig.h | 10 ++++++
 include/linux/string.h  |  7 ++++
 include/malloc.h        | 37 +++++++++++++++++++++
 include/memory.h        | 10 ++++++
 include/of.h            |  2 +-
 include/stdio.h         | 24 ++++++++++++--
 include/stdlib.h        | 19 ++++++++++-
 include/unistd.h        | 72 +++++++++++++++++++++++++++++++++++++++++
 include/xfuncs.h        | 19 +++++++++++
 16 files changed, 246 insertions(+), 9 deletions(-)

-- 
2.39.5




^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-10-16  9:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-16  9:01 [PATCH 00/13] Remove dependency on ld --gc-section in PBL Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 01/13] kconfig: add IS_PROPER helper Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 02/13] lib: random: add stubs for PBL Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 03/13] bootsource: stub out when in PBL Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 04/13] crypto: provide crypto_memneq for PBL Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 05/13] cdev: stub out cdev_read/write " Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 06/13] libfile: stub out file descriptor API " Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 07/13] environment: stub out environment " Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 08/13] of: stub out live tree API when using PBL Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 09/13] errno: stub out perror/strerror API when built for PBL Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 10/13] xfuncs: stub out " Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 11/13] stdio: stub out basprintf and friends " Ahmad Fatoum
2024-10-16  9:40   ` [PATCH] fixup! errno: stub out perror/strerror API " Ahmad Fatoum
2024-10-16  9:40   ` [PATCH 11/13] stdio: stub out basprintf and friends " Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 12/13] memory: stub out request_barebox_region " Ahmad Fatoum
2024-10-16  9:01 ` [PATCH 13/13] malloc: add PBL stubs Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox