[Xiaomi Poco X3 NFC Questions & Answers] lebigmac:
Ok so after setting the ANDROID_BUILD_TOP environment variable to . I managed to get a little bit further but now I get a whole bunch of warnings and an error:

Header: out/target/product/generic/obj/include/libwpa_client/wpa_ctrl.h
host C: mkbootfs <= system/core/cpio/mkbootfs.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
system/core/cpio/mkbootfs.c: In function ‘_eject’:
system/core/cpio/mkbootfs.c:82:20: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
82 | if(strlen(out) != olen) die("ACK!");
| ^~
host Executable: mkbootfs (out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs)
true
host C: acp <= build/tools/acp/acp.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C++: libhost <= build/libs/host/pseudolocalize.cpp
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libhost <= build/libs/host/CopyFile.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host StaticLib: libhost (out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
true
Install: out/host/linux-x86/bin/acp
Install: out/host/linux-x86/bin/mkbootfs
host C: minigzip <= external/zlib/minigzip.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
In file included from external/zlib/minigzip.c:18:
external/zlib/minigzip.c: In function ‘file_compress’:
external/zlib/zlib.h:1575:18: warning: implicit declaration of function ‘gzopen64’; did you mean ‘gzopen’? [-Wimplicit-function-declaration]
1575 | # define gzopen gzopen64
| ^~~~~~~~
external/zlib/minigzip.c:283:11: note: in expansion of macro ‘gzopen’
283 | out = gzopen(outfile, mode);
| ^~~~~~
external/zlib/minigzip.c:283:9: warning: assignment to ‘gzFile’ {aka ‘void *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
283 | out = gzopen(outfile, mode);
| ^
external/zlib/minigzip.c: In function ‘file_uncompress’:
external/zlib/minigzip.c:322:8: warning: assignment to ‘gzFile’ {aka ‘void *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
322 | in = gzopen(infile, "rb");
| ^
external/zlib/minigzip.c: In function ‘main’:
external/zlib/minigzip.c:412:26: warning: assignment to ‘gzFile’ {aka ‘void *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
412 | file = gzopen(*argv, "rb");
| ^
host C: libz <= external/zlib/adler32.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/compress.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/crc32.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/gzclose.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/gzlib.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/gzread.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/gzwrite.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/uncompr.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/deflate.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/trees.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/zutil.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/inflate.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
external/zlib/inflate.c: In function ‘inflateMark’:
external/zlib/inflate.c:1475:61: warning: left shift of negative value [-Wshift-negative-value]
1475 | if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
| ^~
external/zlib/inflate.c: In function ‘inflate’:
external/zlib/inflate.c:704:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
704 | state->mode = EXLEN;
| ~~~~~~~~~~~~^~~~~~~
external/zlib/inflate.c:705:9: note: here
705 | case EXLEN:
| ^~~~
external/zlib/inflate.c:716:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
716 | state->mode = EXTRA;
| ~~~~~~~~~~~~^~~~~~~
external/zlib/inflate.c:717:9: note: here
717 | case EXTRA:
| ^~~~
external/zlib/inflate.c:738:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
738 | state->mode = NAME;
| ~~~~~~~~~~~~^~~~~~
external/zlib/inflate.c:739:9: note: here
739 | case NAME:
| ^~~~
external/zlib/inflate.c:759:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
759 | state->mode = COMMENT;
| ~~~~~~~~~~~~^~~~~~~~~
external/zlib/inflate.c:760:9: note: here
760 | case COMMENT:
| ^~~~
external/zlib/inflate.c:779:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
779 | state->mode = HCRC;
| ~~~~~~~~~~~~^~~~~~
external/zlib/inflate.c:780:9: note: here
780 | case HCRC:
| ^~~~
external/zlib/inflate.c:802:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
802 | state->mode = DICT;
| ~~~~~~~~~~~~^~~~~~
external/zlib/inflate.c:803:9: note: here
803 | case DICT:
| ^~~~
external/zlib/inflate.c:809:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
809 | state->mode = TYPE;
| ~~~~~~~~~~~~^~~~~~
external/zlib/inflate.c:810:9: note: here
810 | case TYPE:
| ^~~~
external/zlib/inflate.c:811:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
811 | if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
| ^
external/zlib/inflate.c:812:9: note: here
812 | case TYPEDO:
| ^~~~
external/zlib/inflate.c:861:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
861 | if (flush == Z_TREES) goto inf_leave;
| ^
external/zlib/inflate.c:862:9: note: here
862 | case COPY_:
| ^~~~
external/zlib/inflate.c:863:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
863 | state->mode = COPY;
| ~~~~~~~~~~~~^~~~~~
external/zlib/inflate.c:864:9: note: here
864 | case COPY:
| ^~~~
external/zlib/inflate.c:1003:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
1003 | if (flush == Z_TREES) goto inf_leave;
| ^
external/zlib/inflate.c:1004:9: note: here
1004 | case LEN_:
| ^~~~
external/zlib/inflate.c:1005:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
1005 | state->mode = LEN;
| ~~~~~~~~~~~~^~~~~
external/zlib/inflate.c:1006:9: note: here
1006 | case LEN:
| ^~~~
external/zlib/inflate.c:1054:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
1054 | state->mode = LENEXT;
| ~~~~~~~~~~~~^~~~~~~~
external/zlib/inflate.c:1055:9: note: here
1055 | case LENEXT:
| ^~~~
external/zlib/inflate.c:1064:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
1064 | state->mode = DIST;
| ~~~~~~~~~~~~^~~~~~
external/zlib/inflate.c:1065:9: note: here
1065 | case DIST:
| ^~~~
external/zlib/inflate.c:1091:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
1091 | state->mode = DISTEXT;
| ~~~~~~~~~~~~^~~~~~~~~
external/zlib/inflate.c:1092:9: note: here
1092 | case DISTEXT:
| ^~~~
external/zlib/inflate.c:1107:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
1107 | state->mode = MATCH;
| ~~~~~~~~~~~~^~~~~~~
external/zlib/inflate.c:1108:9: note: here
1108 | case MATCH:
| ^~~~
external/zlib/inflate.c:1182:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
1182 | state->mode = LENGTH;
| ~~~~~~~~~~~~^~~~~~~~
external/zlib/inflate.c:1183:9: note: here
1183 | case LENGTH:
| ^~~~
external/zlib/inflate.c:1195:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
1195 | state->mode = DONE;
| ~~~~~~~~~~~~^~~~~~
external/zlib/inflate.c:1196:9: note: here
1196 | case DONE:
| ^~~~
host C: libz <= external/zlib/infback.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
external/zlib/infback.c: In function ‘inflateBack’:
external/zlib/infback.c:471:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
471 | state->mode = LEN;
| ~~~~~~~~~~~~^~~~~
external/zlib/infback.c:473:9: note: here
473 | case LEN:
| ^~~~
host C: libz <= external/zlib/inftrees.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libz <= external/zlib/inffast.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host StaticLib: libz (out/host/linux-x86/obj/STATIC_LIBRARIES/libz_intermediates/libz.a)
host Executable: minigzip (out/host/linux-x86/obj/EXECUTABLES/minigzip_intermediates/minigzip)
true
Notice file: external/zlib/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//bin/minigzip.txt
Notice file: external/zlib/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//lib/libz.a.txt
Install: out/host/linux-x86/bin/minigzip
host C: mkbootimg <= system/core/mkbootimg/mkbootimg.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
system/core/mkbootimg/mkbootimg.c: In function ‘write_padding’:
system/core/mkbootimg/mkbootimg.c:89:34: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]
89 | if(write(fd, padding, count) != count) {
| ^~
system/core/mkbootimg/mkbootimg.c: In function ‘main’:
system/core/mkbootimg/mkbootimg.c:186:15: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign]
186 | strcpy(hdr.name, board);
| ~~~^~~~~
| |
| unsigned char *
In file included from system/core/mkbootimg/mkbootimg.c:20:
/usr/include/string.h:121:14: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’
121 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
| ^~~~~~
system/core/mkbootimg/mkbootimg.c:231:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
231 | sha = SHA_final(&ctx);
| ^
system/core/mkbootimg/mkbootimg.c:244:48: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]
244 | if(write(fd, kernel_data, hdr.kernel_size) != hdr.kernel_size) goto fail;
| ^~
system/core/mkbootimg/mkbootimg.c:247:50: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]
247 | if(write(fd, ramdisk_data, hdr.ramdisk_size) != hdr.ramdisk_size) goto fail;
| ^~
system/core/mkbootimg/mkbootimg.c:251:52: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]
251 | if(write(fd, second_data, hdr.second_size) != hdr.second_size) goto fail;
| ^~
host C: libmincrypt <= system/core/libmincrypt/rsa.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
host C: libmincrypt <= system/core/libmincrypt/sha.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
system/core/libmincrypt/sha.c: In function ‘SHA_update’:
system/core/libmincrypt/sha.c:153:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
153 | while (len > sizeof(ctx->buf) - i) {
| ^
host StaticLib: libmincrypt (out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/libmincrypt.a)
host Executable: mkbootimg (out/host/linux-x86/obj/EXECUTABLES/mkbootimg_intermediates/mkbootimg)
true
Notice file: system/core/libmincrypt/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//lib/libmincrypt.a.txt
Install: out/host/linux-x86/bin/mkbootimg
/bin/bash: / 2048 * (2048+64): syntax error: operand expected (error token is "/ 2048 * (2048+64)")
make crespo
rm -rf out/patch_device/crespo
mkdir -p out/patch_device
mkdir -p out/patch_device/crespo
mkdir -p out/patch_device/crespo/root
cp -rf patch_device/crespo/root out/patch_device/crespo/
cp -rf patch_device/crespo/kernel out/patch_device/crespo/
cp -rf out/target/product/generic/root/sbin out/patch_device/crespo/root/
cp: cannot stat 'out/target/product/generic/root/sbin': No such file or directory
make: *** [patch_device/common/miui_recovery.mk:52: crespo] Error 1