[QBS] Android support in Qbs

Jake Petroules jake at fleksy.com
Mon Jan 5 21:53:33 CET 2015


Hey,

So I’ve tried out the new Android support and so far there are some major issues (I think). Since I haven’t really used profile multiplexing yet, I’m not sure if how I’m invoking Qbs is correct:

qbs profile:android

With this I receive:

ERROR: /share/qbs/modules/cpp/linux-gcc.qbs:4 TypeError: Result of expression 'qbs.toolchain' [undefined] is not an object.

Maybe that’s a bug, but suppressing that I still receive an error when running:

qbs profile:android qbs.toolchain:gcc

ERROR: [REDACTED].qbs:3:1 Product dependency 'jsoncpp' not found for profile 'android'.

Since this is a closed source project I can’t really give a more concrete example, but even if I explicitly try to build jsoncpp (which is based on a StaticLibrary item) the build fails, even if the entire contents are removed:

// jsoncpp.qbs
import qbs
StaticLibrary {}
// jsoncpp.qbs

qbs -p jsoncpp profile:android qbs.toolchain:gcc

I thought this was the proper invocation for profile multiplexing, and I set up the Android profile with the qbs-setup-android tool which seemed to succeed and looks reasonable:

profiles.android.Android.sdk.buildToolsVersion: "21.1.2"
profiles.android.Android.sdk.platform: "android-21"
profiles.android.Android.sdk.sdkDir: "/Users/jakepetroules/android-sdk-macosx"
profiles.android.qbs.architecture: "blubb"
profiles.android.qbs.targetOS: ["android", "linux"]
profiles.android_arm64-v8a.Android.ndk.abi: "arm64-v8a"
profiles.android_arm64-v8a.Android.ndk.buildProfile: "arm64-v8a"
profiles.android_arm64-v8a.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fpic", "-fstack-protector", "-funswitch-loops", "-finline-limit=300"]
profiles.android_arm64-v8a.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fpic", "-fstack-protector", "-O2", "-fstrict-aliasing", "-funswitch-loops", "-finline-limit=300"]
profiles.android_arm64-v8a.Android.ndk.hardFp: false
profiles.android_arm64-v8a.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_arm64-v8a.cpp.compilerName: "gcc"
profiles.android_arm64-v8a.cpp.debugInformation: true
profiles.android_arm64-v8a.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now"]
profiles.android_arm64-v8a.cpp.linkerName: "g++"
profiles.android_arm64-v8a.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_arm64-v8a.cpp.toolchainPrefix: "aarch64-linux-android-"
profiles.android_arm64-v8a.qbs.architecture: "arm64"
profiles.android_arm64-v8a.qbs.targetOS: ["android", "linux"]
profiles.android_arm64-v8a.qbs.toolchain: ["gcc"]
profiles.android_armeabi-v7a-hard.Android.ndk.abi: "armeabi-v7a"
profiles.android_armeabi-v7a-hard.Android.ndk.buildProfile: "armeabi-v7a-hard"
profiles.android_armeabi-v7a-hard.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fpic", "-fstack-protector", "-march=armv7-a", "-mfpu=vfpv3-d16", "-mhard-float", "-finline-limit=64"]
profiles.android_armeabi-v7a-hard.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fpic", "-fstack-protector", "-march=armv7-a", "-mfpu=vfpv3-d16", "-mhard-float", "-Os", "-fno-strict-aliasing", "-finline-limit=64"]
profiles.android_armeabi-v7a-hard.Android.ndk.hardFp: true
profiles.android_armeabi-v7a-hard.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_armeabi-v7a-hard.cpp.compilerName: "gcc"
profiles.android_armeabi-v7a-hard.cpp.debugInformation: true
profiles.android_armeabi-v7a-hard.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now", "-march=armv7-a", "-Wl,--fix-cortex-a8", "-Wl,-no-warn-mismatch"]
profiles.android_armeabi-v7a-hard.cpp.linkerName: "g++"
profiles.android_armeabi-v7a-hard.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_armeabi-v7a-hard.cpp.toolchainPrefix: "arm-linux-androideabi-"
profiles.android_armeabi-v7a-hard.qbs.architecture: "arm"
profiles.android_armeabi-v7a-hard.qbs.targetOS: ["android", "linux"]
profiles.android_armeabi-v7a-hard.qbs.toolchain: ["gcc"]
profiles.android_armeabi-v7a.Android.ndk.abi: "armeabi-v7a"
profiles.android_armeabi-v7a.Android.ndk.buildProfile: "armeabi-v7a"
profiles.android_armeabi-v7a.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fpic", "-fstack-protector", "-march=armv7-a", "-mfpu=vfpv3-d16", "-mfloat-abi=softfp", "-finline-limit=64"]
profiles.android_armeabi-v7a.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fpic", "-fstack-protector", "-march=armv7-a", "-mfpu=vfpv3-d16", "-mfloat-abi=softfp", "-Os", "-fno-strict-aliasing", "-finline-limit=64"]
profiles.android_armeabi-v7a.Android.ndk.hardFp: false
profiles.android_armeabi-v7a.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_armeabi-v7a.cpp.compilerName: "gcc"
profiles.android_armeabi-v7a.cpp.debugInformation: true
profiles.android_armeabi-v7a.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now", "-march=armv7-a", "-Wl,--fix-cortex-a8"]
profiles.android_armeabi-v7a.cpp.linkerName: "g++"
profiles.android_armeabi-v7a.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_armeabi-v7a.cpp.toolchainPrefix: "arm-linux-androideabi-"
profiles.android_armeabi-v7a.qbs.architecture: "arm"
profiles.android_armeabi-v7a.qbs.targetOS: ["android", "linux"]
profiles.android_armeabi-v7a.qbs.toolchain: ["gcc"]
profiles.android_armeabi.Android.ndk.abi: "armeabi"
profiles.android_armeabi.Android.ndk.buildProfile: "armeabi"
profiles.android_armeabi.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fpic", "-fstack-protector", "-march=armv5te", "-mtune=xscale", "-msoft-float", "-finline-limit=64"]
profiles.android_armeabi.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fpic", "-fstack-protector", "-march=armv5te", "-mtune=xscale", "-msoft-float", "-Os", "-fno-strict-aliasing", "-finline-limit=64"]
profiles.android_armeabi.Android.ndk.hardFp: false
profiles.android_armeabi.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_armeabi.cpp.compilerName: "gcc"
profiles.android_armeabi.cpp.debugInformation: true
profiles.android_armeabi.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now"]
profiles.android_armeabi.cpp.linkerName: "g++"
profiles.android_armeabi.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_armeabi.cpp.toolchainPrefix: "arm-linux-androideabi-"
profiles.android_armeabi.qbs.architecture: "arm"
profiles.android_armeabi.qbs.targetOS: ["android", "linux"]
profiles.android_armeabi.qbs.toolchain: ["gcc"]
profiles.android_mips.Android.ndk.abi: "mips"
profiles.android_mips.Android.ndk.buildProfile: "mips"
profiles.android_mips.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fpic", "-finline-functions", "-fmessage-length=0", "-fno-inline-functions-called-once", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers"]
profiles.android_mips.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fpic", "-fno-strict-aliasing", "-finline-functions", "-fmessage-length=0", "-fno-inline-functions-called-once", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers", "-O2", "-funswitch-loops", "-finline-limit=300"]
profiles.android_mips.Android.ndk.hardFp: false
profiles.android_mips.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_mips.cpp.compilerName: "gcc"
profiles.android_mips.cpp.debugInformation: true
profiles.android_mips.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now"]
profiles.android_mips.cpp.linkerName: "g++"
profiles.android_mips.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/mipsel-linux-android-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_mips.cpp.toolchainPrefix: "mipsel-linux-android-"
profiles.android_mips.qbs.architecture: "mipsel"
profiles.android_mips.qbs.targetOS: ["android", "linux"]
profiles.android_mips.qbs.toolchain: ["gcc"]
profiles.android_mips64.Android.ndk.abi: "mips64"
profiles.android_mips64.Android.ndk.buildProfile: "mips64"
profiles.android_mips64.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fpic", "-finline-functions", "-fmessage-length=0", "-fno-inline-functions-called-once", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers"]
profiles.android_mips64.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fpic", "-fno-strict-aliasing", "-finline-functions", "-fmessage-length=0", "-fno-inline-functions-called-once", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers", "-O2", "-funswitch-loops", "-finline-limit=300"]
profiles.android_mips64.Android.ndk.hardFp: false
profiles.android_mips64.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_mips64.cpp.compilerName: "gcc"
profiles.android_mips64.cpp.debugInformation: true
profiles.android_mips64.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now"]
profiles.android_mips64.cpp.linkerName: "g++"
profiles.android_mips64.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_mips64.cpp.toolchainPrefix: "mips64el-linux-android-"
profiles.android_mips64.qbs.architecture: "mips64el"
profiles.android_mips64.qbs.targetOS: ["android", "linux"]
profiles.android_mips64.qbs.toolchain: ["gcc"]
profiles.android_x86.Android.ndk.abi: "x86"
profiles.android_x86.Android.ndk.buildProfile: "x86"
profiles.android_x86.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fstack-protector", "-funswitch-loops", "-finline-limit=300"]
profiles.android_x86.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fstack-protector", "-O2", "-fstrict-aliasing", "-funswitch-loops", "-finline-limit=300"]
profiles.android_x86.Android.ndk.hardFp: false
profiles.android_x86.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_x86.cpp.compilerName: "gcc"
profiles.android_x86.cpp.debugInformation: true
profiles.android_x86.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now"]
profiles.android_x86.cpp.linkerName: "g++"
profiles.android_x86.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_x86.cpp.toolchainPrefix: "i686-linux-android-"
profiles.android_x86.qbs.architecture: "x86"
profiles.android_x86.qbs.targetOS: ["android", "linux"]
profiles.android_x86.qbs.toolchain: ["gcc"]
profiles.android_x86_64.Android.ndk.abi: "x86_64"
profiles.android_x86_64.Android.ndk.buildProfile: "x86_64"
profiles.android_x86_64.Android.ndk.compilerFlagsDebug: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O0", "-fstack-protector", "-funswitch-loops", "-finline-limit=300"]
profiles.android_x86_64.Android.ndk.compilerFlagsRelease: ["-ffunction-sections", "-funwind-tables", "-no-canonical-prefixes", "-Wa,--noexecstack", "-Werror=format-security", "-fomit-frame-pointer", "-fstack-protector", "-O2", "-fstrict-aliasing", "-funswitch-loops", "-finline-limit=300"]
profiles.android_x86_64.Android.ndk.hardFp: false
profiles.android_x86_64.Android.ndk.ndkDir: "/Users/jakepetroules/android-ndks/android-ndk-r10d"
profiles.android_x86_64.cpp.compilerName: "gcc"
profiles.android_x86_64.cpp.debugInformation: true
profiles.android_x86_64.cpp.linkerFlags: ["-no-canonical-prefixes", "-Wl,-z,noexecstack", "-Wl,-z,relro", "-Wl,-z,now"]
profiles.android_x86_64.cpp.linkerName: "g++"
profiles.android_x86_64.cpp.toolchainInstallPath: "/Users/jakepetroules/android-ndks/android-ndk-r10d/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin"
profiles.android_x86_64.cpp.toolchainPrefix: "x86_64-linux-android-"
profiles.android_x86_64.qbs.architecture: "x86_64"
profiles.android_x86_64.qbs.targetOS: ["android", "linux"]
profiles.android_x86_64.qbs.toolchain: ["gcc"]

We should have more documentation in the Qbs manual on how to use profile multiplexing and/or Android build specifically, because if I as a Qbs developer don’t know how to use it, I doubt users will be able to figure it out intuitively.

PS - No “blubb” architecture - change that to “invalid” or something. :)
-- 
Jake Petroules - jake at fleksy.com
Software Engineer - Fleksy Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20150105/455e45e7/attachment.html>


More information about the Qbs mailing list