[RFC] Fix misc warnings when building sandbox on 64-bits

Loïc Minier loic.minier at linaro.org
Thu Oct 13 18:06:36 EDT 2011


        Hi

 I was getting a bunch of different warnings, some quite annoying ones,
 when building sandbox on x86-64, not all of them related to 64-bits.

 I'm completely new to the barebox codebase and not necessarily familiar
 with the linux kernel header usage in barebox, so sending these patches
 as RFC to see what others think of the fixes.

 Some comments on the patches:

 The first two seems pretty safe:
 - Only pass -P to cpp when generating ld scripts
 - Avoid warnings by using format(__printf__)

 This one might change some API but seems right in terms of semantics;
 sandbox builds and starts up fine:
 - fprintf() returns an int

 These two are some shots at supporting sandbox on x86-64:
 - Use %p in format for pointers
 - Use size_t for memory offsets
 essentially I've noticed that nobody is setting
 CONFIG_PHYS_ADDR_T_64BIT, yet barebox uses the resource_size_t type
 which requires this config to be set properly.  Now, because I don't
 set CONFIG_PHYS_ADDR_T_64BIT in this patch series, what you'll get is
 actually new warnings after the changes to use size_t or %p for
 pointers because they are still stored on u32 on x86-64...  Also, this
 might break some API/ABI.  I don't really know how to set
 CONFIG_PHYS_ADDR_T_64BIT automatically for sandbox, so suggestions
 welcome.

    Thanks!
-- 
Loïc Minier



More information about the barebox mailing list