xref: /aosp_15_r20/prebuilts/runtime/mainline/README_riscv64.md (revision 924841fff420cd6b931e1027ee46b85e0a18fe17)
1*924841ffSAndroid Build Coastguard WorkerUnlike other architectures, riscv64 is not supported by mainline yet
2*924841ffSAndroid Build Coastguard Worker(see b/286551985#comment6 for reasons why). Therefore we have to follow a
3*924841ffSAndroid Build Coastguard Workersemi-manual update process described below.
4*924841ffSAndroid Build Coastguard Worker
5*924841ffSAndroid Build Coastguard WorkerThis is not a fully correct process, as the prebuilts are taken from an
6*924841ffSAndroid Build Coastguard Workerarbitrary local build, and only for riscv64. Common architecture-independent
7*924841ffSAndroid Build Coastguard Workerparts of the SDKs such as headers are not updated, as that would affect
8*924841ffSAndroid Build Coastguard Workerarchitectures other than riscv64. One can only hope they did not diverge too
9*924841ffSAndroid Build Coastguard Workermuch from the previous update.
10*924841ffSAndroid Build Coastguard Worker
11*924841ffSAndroid Build Coastguard WorkerFor conscrypt and statsd, we (the ART team) don't have the ownership to commit
12*924841ffSAndroid Build Coastguard Workerthe updates in their proper repositories, prebuilts/module_sdk/conscrypt and
13*924841ffSAndroid Build Coastguard Workerprebuilts/module_sdk/StatsD. Therefore as a temporary workaround these prebuilts
14*924841ffSAndroid Build Coastguard Workerare committed in prebuilts/runtime/mainline/local_riscv64. Before the build
15*924841ffSAndroid Build Coastguard Workerstarts, they are copied to their proper places by the art/tools/buildbot-*.sh
16*924841ffSAndroid Build Coastguard Workerscripts.
17*924841ffSAndroid Build Coastguard Worker
18*924841ffSAndroid Build Coastguard WorkerTo update:
19*924841ffSAndroid Build Coastguard Worker
20*924841ffSAndroid Build Coastguard Worker1. On aosp/main (full manifest):
21*924841ffSAndroid Build Coastguard Worker
22*924841ffSAndroid Build Coastguard Worker   1. Cherry pick https://r.android.com/2647900 (this is necessary for the SDK
23*924841ffSAndroid Build Coastguard Worker      build in step 4).
24*924841ffSAndroid Build Coastguard Worker
25*924841ffSAndroid Build Coastguard Worker   2. Build implementation libs:
26*924841ffSAndroid Build Coastguard Worker      ```
27*924841ffSAndroid Build Coastguard Worker      $ lunch aosp_riscv64-trunk_staging-userdebug
28*924841ffSAndroid Build Coastguard Worker      $ m dist
29*924841ffSAndroid Build Coastguard Worker      ```
30*924841ffSAndroid Build Coastguard Worker
31*924841ffSAndroid Build Coastguard Worker   3. Build apexes:
32*924841ffSAndroid Build Coastguard Worker      ```
33*924841ffSAndroid Build Coastguard Worker      $ banchan \
34*924841ffSAndroid Build Coastguard Worker          com.android.runtime \
35*924841ffSAndroid Build Coastguard Worker          com.android.tzdata \
36*924841ffSAndroid Build Coastguard Worker          com.android.os.statsd \
37*924841ffSAndroid Build Coastguard Worker          com.android.conscrypt \
38*924841ffSAndroid Build Coastguard Worker          com.android.i18n \
39*924841ffSAndroid Build Coastguard Worker          riscv64
40*924841ffSAndroid Build Coastguard Worker      $ m DIST_DIR=out/dist/mainline_modules_riscv64 dist
41*924841ffSAndroid Build Coastguard Worker      ```
42*924841ffSAndroid Build Coastguard Worker
43*924841ffSAndroid Build Coastguard Worker   4. Build module SDKs:
44*924841ffSAndroid Build Coastguard Worker      ```
45*924841ffSAndroid Build Coastguard Worker      $ packages/modules/common/build/mainline_modules_sdks.sh \
46*924841ffSAndroid Build Coastguard Worker          --build-release latest \
47*924841ffSAndroid Build Coastguard Worker          --build-platform-sdks-for-mainline
48*924841ffSAndroid Build Coastguard Worker      ```
49*924841ffSAndroid Build Coastguard Worker
50*924841ffSAndroid Build Coastguard Worker2. On aosp/master-art branch (reduced manifest):
51*924841ffSAndroid Build Coastguard Worker
52*924841ffSAndroid Build Coastguard Worker   1. Run:
53*924841ffSAndroid Build Coastguard Worker      ```
54*924841ffSAndroid Build Coastguard Worker      $ prebuilts/runtime/mainline/update.py \
55*924841ffSAndroid Build Coastguard Worker          --local-dist-riscv64 <root-of-aosp-tree>/out/dist
56*924841ffSAndroid Build Coastguard Worker      ```
57*924841ffSAndroid Build Coastguard Worker
58*924841ffSAndroid Build Coastguard Worker   2. Manually inspect the updated Android.bp files and revert any sections not
59*924841ffSAndroid Build Coastguard Worker      related to riscv64 (it may be necessary to revert the entire file). Then try
60*924841ffSAndroid Build Coastguard Worker      to build with `lunch riscv64 && art/tools/buildbot-build.sh`, you may find
61*924841ffSAndroid Build Coastguard Worker      that further tweaking is needed. Make sure that the build succeeds.
62*924841ffSAndroid Build Coastguard Worker
63*924841ffSAndroid Build Coastguard Worker   3. Update the commit (use `lunch riscv64 && art/tools/buildbot-build.sh` as a
64*924841ffSAndroid Build Coastguard Worker      validation step in commit message). Be sure to set mast@ as reviewer.
65