Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The code compiles unsuccessfully with android-ndk-r10e #1499

Closed
SheilaLundin opened this issue Mar 1, 2019 · 2 comments
Closed

The code compiles unsuccessfully with android-ndk-r10e #1499

SheilaLundin opened this issue Mar 1, 2019 · 2 comments
Labels
solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope)

Comments

@SheilaLundin
Copy link

With single header file json.hpp
Source Code:

#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include "json.hpp"
using namespace std;
using json = nlohmann::json;

int main()
{
    json j;
    j["pi"] = 3.141;
    j["hello"] = "world";
    std::cout << j << std::endl;
    return 0;
}

Android.mk:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test
LOCAL_C_INCLUDES := $(NDK_MODULE_PATH)/include
LOCAL_SRC_FILES := test.cpp
include $(BUILD_EXECUTABLE)

Application.mk:

APP_ABI := armeabi-v7a
APP_PLATFORM := android-21
APP_STL := c++_static
APP_CPPFLAGS += -frtti -fexceptions -std=c++11
NDK_TOOLCHAIN_VERSION := clang3.6

Clang output:

[armeabi-v7a] Compile++ thumb: test <= test.cpp
Assertion failed!

Program: D:\Android\android-ndk-r10e\toolchains\llvm-3.6\prebuilt\windows-x86_64\bin\clang++.exe
File: /s/ndk-toolchain/src/llvm-3.6/llvm/lib/IR/Metadata.cpp, Line 158

Expression: !(MD && isa<MDNodeFwdDecl>(MD)) && "Expected non-temp node"
clang++.exe: error: clang frontend command failed with exit code 3 (use -v to see invocation)
clang version 3.6
Target: armv7-none-linux-androideabi
Thread model: posix
@nlohmann
Copy link
Owner

nlohmann commented Mar 1, 2019

The assertion seems to be outside of the library.

@jaredgrubb
Copy link
Contributor

That is a compiler crash (ICE) and there is nothing we can do to prevent that. Looks like maybe Microsoft already fixed it:
microsoft/llvm@e56d199

@nlohmann nlohmann added the solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope) label Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope)
Projects
None yet
Development

No branches or pull requests

3 participants