Project

General

Profile

Toolchain » History » Version 4

Wolfgang Wiedmeyer, 04/27/2017 03:23 PM
big update

1 1 Wolfgang Wiedmeyer
h1. Toolchain
2
3 2 Wolfgang Wiedmeyer
Development efforts to get rid of prebuilt binaries in the Replicant source code are tracked on this page. Prebuilts usually belong to the toolchain, but they can also be found in other parts of the source code. Most of them reside in the @prebuilts@ directory.
4 1 Wolfgang Wiedmeyer
5 4 Wolfgang Wiedmeyer
h2. Goals
6 1 Wolfgang Wiedmeyer
7 4 Wolfgang Wiedmeyer
These binaries are committed to AOSP git repos and in most cases, it is poorly documented, how they can be rebuilt, or the documentation is outdated. Compiler rebuild scripts rely on the prebuilt compilers to build the compilers. It is possible that non-free software was used to build the prebuilts (e.g. Google-internal Java compiler). To keep the build trustworthy, we need to make sure, that as little prebuilts as possible are used.
8 1 Wolfgang Wiedmeyer
9 4 Wolfgang Wiedmeyer
The focus should be on prebuilts that run on the build machine, so basically all prebuilts that belong to the toolchain. We first need to make sure that the toolchain can be trusted by developers and users that build Replicant from source. Then we can focus on binaries that only run on the target devices.
10 1 Wolfgang Wiedmeyer
11 4 Wolfgang Wiedmeyer
Only building an image for a device needs to work for now.
12
13
h2. Strategy
14
15
Building as much from source as possible is one strategy to achieve this. Using packaged versions of the prebuilts that are provided by GNU/Linux distributions is an alternative way to ensure that the binaries can be trusted. If the prebuilts are available as packages, then these should be preferred before a clean build from source is investigated. A clean build means that no prebuilts from the AOSP or LineageOS source code are required. 
16
Working on getting build tools packaged by distributions should also be a goal.
17
18
h3. Choosing a main target distribution for building Replicant
19
20
21
22 1 Wolfgang Wiedmeyer
h2. TODO
23 4 Wolfgang Wiedmeyer
24
h3. NDK
25
26
The Android ARM cross-compiler build uses the sysroot from @prebuilts/ndk/current/platforms/android-21/arch-arm@. The compiler needs to be bootstrapped with proper 1st and 2nd stage compilers so it doesn't rely on the sysroot from the NDK.
27
28
Some Makefiles in @build@ reference binaries from @prebuilts/ndk@. It needs to be checked if they are used during an image build and if so whether they can be replaced.
29
30
h3. SDK
31
32
There are still prebuilt libraries and target APIs in @prebuilts/sdk@. It needs to be investigated which of the libraries are needed to build an image and if the needed ones are already packaged by Debian. It is probably too much work to replace the different target API jar files, so we have to wait until they are packaged by Debian.
33 3 Wolfgang Wiedmeyer
34
h3. @repo@
35
36
Get the @repo@ tool back into the main repository of Debian. It is currently in the contrib repo due to "bug #855846":https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%23855846. A substantial patch is needed, which should remove the self-updating part of @repo@ or make it optional.