README.md updated
authorJacek Kryszyn <j.kryszyn@samsung.com>
Thu, 21 Sep 2023 10:59:44 +0000 (12:59 +0200)
committerJacek Kryszyn <j.kryszyn@samsung.com>
Thu, 21 Sep 2023 10:59:44 +0000 (12:59 +0200)
README.md
make.sh

index 9ecaf1211bd19a8facadadb1ebb51490dff0035a..9aa4a3db32b4d29b4881847ac038890a8f8cdf86 100755 (executable)
--- a/README.md
+++ b/README.md
@@ -2,29 +2,47 @@ Original project: https://github.com/LonelyFool/lpunpack_and_lpmake
 Copied from commit 7ec860cfa95ed83dec579ab0459aad1c35ad48e4
 
 # lpunpack and lpmake
-To compile x86_64 you need:
-- clang (sudo apt install clang)
-- zlib (sudo apt install zlib1g-dev)
 
-To cross-compile you need:
-- Ubuntu 22.04: `crossbuild-essential-arm64`/`crossbuild-essential-armel`/`crossbuild-essential-armhf` (sudo apt install $package).
-- Ubuntu 20.04: `sudo apt install gcc-10-aarch64-linux-gnu` and `sudo apt install g++-aarch64-linux-gnu`
+It is not possible to build this project on Ubuntu 20.04 using gcc 9.x due to an internal compiler error:
 
-On Ubuntu 20.04 `crossbuild-essential-arm64`` uses gcc 9.x  which gives an internal error during build. This is why gcc-10 version has to be installed explicitly.
+```
+In file included from $project_path/lib/base/logging.cpp:64:
+$project_path/lib/base/logging_splitters.h: In lambda function:
+$project_path/lib/base/logging_splitters.h:82:79: internal compiler error: in expand_expr_real_1, at expr.c:10014
+   82 | en = snprintf(logd_chunk + chunk_position, sizeof(logd_chunk) - chunk_position,
+      |                                            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
+
+0x7f07e29ab082 __libc_start_main
+       ../csu/libc-start.c:308
+```
 
-``
-build:
+This is why it is advised to use clang or gcc-10 on Ubuntu 20.04.
+
+## How to build
+
+CMake support was added to this project. You can build partition tools using
 
 ```
 mkdir build
 cd build
 cmake ../
 make
+```
 
+or you can use the original make script:
 ```
+./make.sh
+```
+ This requires:
+- clang (sudo apt install clang)
+- zlib (sudo apt install zlib1g-dev)
 
-or you can use original makefile:
+## Cross-building
+It is possible to cross-build using CMake. Simply invoke cmake with `-DCMAKE_TOOLCHAIN_FILE`:
 
 ```
-make
-```
\ No newline at end of file
+mkdir build && cd build
+cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.make ../
+```
+
+The project contains an exemplary `toolchain.make` file which uses `aarch64-linux-gnu-gcc` and `aarch64-linux-gnu-g++` to build for arm.
\ No newline at end of file
diff --git a/make.sh b/make.sh
index bad817a1eb2feaec4d81fb63aea33743a82abe3d..8dc018893f1b35e29728c5a6b60de1d48137314f 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -546,4 +546,4 @@ $STRIP bin/lpmake
 $STRIP bin/lpadd
 $STRIP bin/lpflash
 $STRIP bin/lpunpack
-$STRIP bin/lpdump
\ No newline at end of file
+$STRIP bin/lpdump