[PATCH] cpukit: Move zlib into librtemcpu.a and do not install libz.a.

Chris Johns chrisj at rtems.org
Wed Sep 17 06:34:37 UTC 2014


On 17/09/2014 4:26 pm, Sebastian Huber wrote:
> On 17/09/14 07:51, Chris Johns wrote:
>> On 17/09/2014 3:30 pm, Sebastian Huber wrote:
>>> On 17/09/14 02:26, Chris Johns wrote:
>>>> The JFFS2 file system can optionally use zlib as a compressor and
>>>> if this is the only reference to zlib the application will not link.
>>>>
>>>> Adding -lz does not work because librtemscpu.a is added to the end of
>>>> ld's command line via the bsp_specs hack and user added libraries
>>>> appear before this.
>>>
>>> If we remove libz.a then this will break all application Makefiles, that
>>> assume that RTEMS provides it.  I would still provide libz.a.
>>>
>>
>> Will the linker complain if the symbols are in 2 separate archives ?
>
> Since the object files are identical it doesn't matter.
>

Hmm still ...

>>
>> To me this will appear confusing and result in questions about which
>> is which
>> and why there are 2 copies.
>
> Yes, it is confusing and brittle, but it doesn't break user Makefiles.
>

So a user's edit for a 4.11 release (ignoring the transition pain for 
those with apps on 4.11) or us having to put up with the questions and 
confusion for the life of 4.11.

> Another option would be to patch GCC:
>
> diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h
> index f14aed3..8f9fa1e 100644
> --- a/gcc/config/rtems.h
> +++ b/gcc/config/rtems.h
> @@ -44,7 +44,7 @@ see the files COPYING3 and COPYING.RUNTIME
> respectively.  If not, see
>   #undef LIB_SPEC
>   #define LIB_SPEC "%{!qrtems: " STD_LIB_SPEC "} " \
>   "%{!nostdlib: %{qrtems: --start-group \
> - -lrtemsbsp -lrtemscpu \
> + -lrtemsbsp -lrtemscpu -lz \
>    -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}"
>
>   #define TARGET_POSIX_IO
>

Yeah this is ok.

Chris



More information about the devel mailing list