base: rm first-class support for static binaries

This patch removes the detection of statically linked executables from
the base framework. It thereby fixes the corner cases encountered with
Sculpt when obtaining the binaries of the runtime from the depot_rom
service that is hosted within the runtime.

Statically linked binaries and hybrid Linux/Genode (lx_hybrid) binaries
can still be started by relabeling the ROM-session route of "ld.lib.so"
to the binary name, pretending that the binary is the dynamic linker.
This can be achieved via init's label rewriting mechanism:

  <route>
    <service name="ROM" unscoped_label="ld.lib.so">
      <parent label="test-platform"/> </service>
  </route>

However, as this is quite cryptic and would need to be applied for all
lx_hybrid components, the patch adds a shortcut to init's configuration.
One can simply add the 'ld="no"' attribute to the <start> node of the
corresponding component:

  <start name="test-platform" ld="no"/>

Fixes #2866
This commit is contained in:
Norman Feske
2018-07-04 18:48:04 +02:00
committed by Christian Helmuth
parent c43ed44b17
commit 4b46abf813
35 changed files with 102 additions and 130 deletions

View File

@ -496,6 +496,10 @@ Init::Child::Route Init::Child::resolve_session_request(Service::Name const &ser
label == _unique_name && _unique_name != _binary_name)
return resolve_session_request(service_name, _binary_name);
/* supply binary as dynamic linker if '<start ld="no">' */
if (!_use_ld && service_name == Rom_session::service_name() && label == "ld.lib.so")
return resolve_session_request(service_name, _binary_name);
/* check for "session_requests" ROM request */
if (service_name == Rom_session::service_name()
&& label.last_element() == Session_requester::rom_name())

View File

@ -90,6 +90,11 @@ class Init::Child : Child_policy, Routed_service::Wakeup
typedef String<80> Version;
Version _version { _start_node->xml().attribute_value("version", Version()) };
/*
* True if the binary is loaded with ld.lib.so
*/
bool const _use_ld = _start_node->xml().attribute_value("ld", true);
Default_route_accessor &_default_route_accessor;
Default_caps_accessor &_default_caps_accessor;
Ram_limit_accessor &_ram_limit_accessor;

View File

@ -144,6 +144,7 @@
</xs:choice>
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="ld" type="xs:string" />
<xs:attribute name="caps" type="xs:int" />
<xs:attribute name="priority" type="xs:int" />
</xs:complexType>