lp://staging/klibc

Created by Thorsten Glaser and last modified
Get this branch:
bzr branch lp://staging/klibc

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Thorsten Glaser
Project:
klibc
Review team:
maximilian attems
Status:
Development

Import details

Import Status: Suspended

This branch is an import of the HEAD branch of the Git repository at git://git.kernel.org/pub/scm/libs/klibc/klibc.git.

Last successful import was .

Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 5 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 10 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 5 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 5 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 10 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-3 and finished taking 5 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 10 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 10 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 5 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 10 seconds — see the log

Recent revisions

2226. By Ben Hutchings

[klibc] 2.0.13 released, next version is 2.0.14

2225. By Ben Hutchings

[klibc] Install command links as appropriate

We build gzip to support being called as "gunzip" or "zcat", and
similarly we build halt to support being called as "poweroff" or
"reboot". In the build directory, we create the aliases as links
to the same binary.

When installing, however, we pass all the names for the same binary to
the "install" command, creating multiple copies of it in the install
directory.

To fix this:

- Define an install_links command that creates links as specified in
  an install-links-y variable.
- Invoke install_links after installing binaries.
- In usr/gzip/Kbuild and usr/utils/Kbuild, specify the links in
  install-links-y instead of install-y.

Reported-by: Benjamin Drung <email address hidden>
References: https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/2028571
Signed-off-by: Ben Hutchings <email address hidden>

2224. By Rob Vandermeulen <email address hidden>

[klibc] kinit: Support specifying root with PARTLABEL

Allow specifying the root device to be mounted as root=PARTLABEL=label.
The label is the GPT partition label of the intended root partition, as
presented by the kernel with the uevent entry PARTNAME.

Signed-off-by: Rob Vandermeulen <email address hidden>
Signed-off-by: Ben Hutchings <email address hidden>

2223. By Ben Hutchings

[klibc] riscv64: Move shared library below executables

The default base address for riscv64 executables is 64 kiB, and I
originally selected a base address for the shared library of 2 MiB.
This limits the size of executables using it to be < 2 MiB, and it
also interacts with a bug in QEMU's user-mode emulation, causing
executables to immediately crash. It doesn't help code generation,
because single-instruction jumps have a range of only ±1 MiB and
two-instruction jumps have a range of ±2 GiB.

Move the shared library to 64 kiB and executables to 576 kiB, to allow
for generation of single-instruction jumps. (klibc.so is currently
much smaller than the 512 kiB this allows for.)

References: https://bugs.debian.org/1040981
Signed-off-by: Ben Hutchings <email address hidden>

2222. By Ben Hutchings

[klibc] arm: Move shared library below executables

The default base address for arm executables is 64 kiB, and the base
address for the shared library is 3.5 MiB when generating Thumb
instructions. This limits the size of executables using it to be
< 3.5 MiB, and it also interacts with a bug in QEMU's user-mode
emulation, causing executables to immediately crash.

Moving the shared library to the end of the 16 MiB range didn't help.
Instead, move the shared library to 2 MiB and executables to 4 MiB.
This works for both Thumb and non-Thumb configurations, so make it
unconditional.

References: https://bugs.debian.org/1040981
Signed-off-by: Ben Hutchings <email address hidden>

2221. By Ben Hutchings

[klibc] mips64: Compatibility with R6 compact branches

MIPS R6 introduced compact branch instructions, including BALC as a
replacement for JAL. Both BALC and JAL have a 26-bit offset field
that's shifted 2 bits left. However, in BALC this is treated as a
PC-relative signed offset (±128 MiB) rather than a segment-relative
unsigned offset (0-256 MiB).

The base address of the klibc shared library therefore needs to change
depending on whether the executable calls it with JAL or BALC.

gcc (but not Clang, currently) generates BALC instructions for
external function calls on R6 targets, which breaks shared library
builds of klibc for these targets. Add a config symbol to control
whether compact branches are used and to change the shared library
base address accordingly.

Signed-off-by: Ben Hutchings <email address hidden>

2220. By Ben Hutchings

[klibc] ipconfig: Retry failed send after 1 second

Currently we check whether a device has link down before attempting to
send a packet, but the send can still fail with ENETDOWN - perhaps due
to racing with the kernel's linkwatch work. After such an error we'll
wait about 10 seconds before retrying.

Since the link check isn't reliable, remove it. Instead, wait only 1
second if we fail to send a packet.

Signed-off-by: Ben Hutchings <email address hidden>

2219. By Ben Hutchings

[klibc] ipconfig: Handle error events from poll

When poll returns events for a socket other than POLLRDNORM, such as
POLLERR, we do not read from the socket but keep polling on it. This
results in busy-polling while the error state persists.

In case some other event is returned, put the device into DEVST_ERROR
state for 1 second.

Signed-off-by: Ben Hutchings <email address hidden>

2218. By Ben Hutchings

[klibc] ipconfig: Do not poll sockets we don't intend to read from

When a device is in state DEVST_COMPLETE or DEVST_ERROR, we never read
packets from its socket, but we still poll it. If the socket is
readable or in an error state, this results in busy-polling until a
timeout is reached.

Only add a device's socket to the fds array when the device is in some
other state.

Signed-off-by: Ben Hutchings <email address hidden>

2217. By Feiyang Chen <email address hidden>

[klibc] Add LoongArch64 port

Add LoongArch64 support. I've cribbed most of this from the
RISC-V and MIPS ports.

Signed-off-by: Feiyang Chen <email address hidden>
Signed-off-by: Ben Hutchings <email address hidden>

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers