[Nexus 4 Android Development] KreAch3R:
Thanks for that! This seemed to make the error go away, but now I get another one:

prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-ld: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-ld)
make: *** [out/target/product/mako/obj/lib/crtbegin_static.o] Error 1
make: *** Waiting for unfinished jobs....

Whole output:

~/android$ make -j4 otapackage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.1
TARGET_PRODUCT=simpleaosp_mako
TARGET_BUILD_VARIANT=user
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-40-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=LRX22C
OUT_DIR=out
============================================
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `phone/java': No such file or directory
find: `phone/java': No such file or directory
find: `dummy': No such file or directory
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
build/core/Makefile:46: warning: overriding commands for target `out/target/product/mako/system/lib/hw/gps.msm8960.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/mako/system/lib/hw/gps.msm8960.so'
build/core/Makefile:46: warning: overriding commands for target `out/target/product/mako/system/lib/libgps.utils.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/mako/system/lib/libgps.utils.so'
build/core/Makefile:46: warning: overriding commands for target `out/target/product/mako/system/lib/libloc_core.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/mako/system/lib/libloc_core.so'
build/core/Makefile:46: warning: overriding commands for target `out/target/product/mako/system/lib/libloc_eng.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/mako/system/lib/libloc_eng.so'
build/core/Makefile:46: warning: overriding commands for target `out/target/product/mako/system/lib/libjni_latinime.so'
build/core/base_rules.mk:550: warning: ignoring old commands for target `out/target/product/mako/system/lib/libjni_latinime.so'
No private recovery resources for TARGET_DEVICE mako
host C: mkbootimg <= system/core/mkbootimg/mkbootimg.c
host C: acp <= build/tools/acp/acp.c
host StaticLib: libmincrypt_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libmincrypt_intermediates/libmincrypt.a)
host StaticLib: libhost_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libhost_intermediates/libhost.a)
host Executable: mkbootfs (out/host/linux-x86/obj32/EXECUTABLES/mkbootfs_intermediates/mkbootfs)
host C: checkpolicy <= external/checkpolicy/queue.c
host C: checkpolicy <= external/checkpolicy/module_compiler.c
host C: checkpolicy <= external/checkpolicy/parse_util.c
external/checkpolicy/module_compiler.c: In function 'add_perm_to_class':
external/checkpolicy/module_compiler.c:710:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/module_compiler.c: In function 'is_scope_in_stack':
external/checkpolicy/module_compiler.c:1233:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/module_compiler.c: In function 'end_optional':
external/checkpolicy/module_compiler.c:1448:22: warning: unused parameter 'pass' [-Wunused-parameter]
external/checkpolicy/module_compiler.c: In function 'copy_requirements':
external/checkpolicy/module_compiler.c:1511:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/module_compiler.c:1517:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
host C: checkpolicy <= external/checkpolicy/policy_define.c
host C: checkpolicy <= external/checkpolicy/checkpolicy.c
external/checkpolicy/policy_define.c: In function 'define_dominance':
external/checkpolicy/policy_define.c:867:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/policy_define.c: In function 'clone_level':
external/checkpolicy/policy_define.c:997:38: warning: unused parameter 'key' [-Wunused-parameter]
external/checkpolicy/policy_define.c: In function 'define_compute_type_helper':
external/checkpolicy/policy_define.c:1569:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/policy_define.c: In function 'dominate_role_recheck':
external/checkpolicy/policy_define.c:2146:3: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/policy_define.c:2152:3: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/policy_define.c:2125:48: warning: unused parameter 'key' [-Wunused-parameter]
external/checkpolicy/policy_define.c: In function 'parse_semantic_categories':
external/checkpolicy/policy_define.c:3445:64: warning: unused parameter 'levdatum' [-Wunused-parameter]
host C++: checkpolicy <= out/host/linux-x86/obj32/EXECUTABLES/checkpolicy_intermediates/policy_parse.cpp
host C++: checkpolicy <= out/host/linux-x86/obj32/EXECUTABLES/checkpolicy_intermediates/policy_scan.cpp
external/checkpolicy/checkpolicy.c: In function 'display_bools':
external/checkpolicy/checkpolicy.c:296:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
external/checkpolicy/checkpolicy.c: In function 'check_level':
external/checkpolicy/checkpolicy.c:364:72: warning: unused parameter 'arg' [-Wunused-parameter]
external/checkpolicy/checkpolicy.c: In function 'main':
external/checkpolicy/checkpolicy.c:472:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
host StaticLib: libsepol_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libsepol_intermediates/libsepol.a)
cc1: warning: command line option '-Wsign-promo' is valid for C++/ObjC++ but not for C [enabled by default]
host C: checkfc <= external/sepolicy/tools/checkfc.c
host StaticLib: libselinux_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libselinux_intermediates/libselinux.a)
cc1: warning: command line option '-Wsign-promo' is valid for C++/ObjC++ but not for C [enabled by default]
target thumb C: init <= system/core/init/builtins.c
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-ld: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-ld)
make: *** [out/target/product/mako/obj/lib/crtbegin_static.o] Error 1
make: *** Waiting for unfinished jobs....

#### make failed to build some targets (01:22 (mm:ss)) ####

I tried to "make clobber" but I get the same. Also, depending on the number of jobs, I get a slightly different output log, but the error is the same. I think I fixed it by using these instructions. Building is now working for now (at least, and I am going to bed).

Could you share how you find out it was your fault? I would love to know how.