First Try To Compile Kernel For Ivan Aosp 5.1.1

Discussion in 'Xiaomi Mi 2 / Mi 2S' started by Haubitze88, May 23, 2015.

  1. Haubitze88

    Haubitze88Members

    Apr 4, 2013
    86
    19
    18
    Male
    I am going to compile my first kernel
    but i stock with some errors were i don't find some informations
    maybe someone can help me

    thx to Ivan for his source code
    http://github.com/mitwo-dev
     
    number19999 likes this.
  2. Haubitze88

    Haubitze88Members

    Apr 4, 2013
    86
    19
    18
    Male
    kernel/exit.c: In function ‘exit_mm’:
    kernel/exit.c:691:28: error: ‘TIF_MM_RELEASED’ undeclared (first use in this function)
    set_tsk_thread_flag(tsk, TIF_MM_RELEASED);
    ^
    kernel/exit.c:691:28: note: each undeclared identifier is reported only once for each function it appears in
    make[1]: *** [kernel/exit.o] Error 1
    make: *** [kernel] Error 2
    thats my actual problem but as i wrote i don't find more informations about that
     
  3. davfiala

    davfialaMembers

    Aug 20, 2013
    550
    199
    80
    Male
    Land Rover addict
    Czech Republic
    You can't use undeclared variable as parameter.
     
    Haubitze88 likes this.
  4. Haubitze88

    Haubitze88Members

    Apr 4, 2013
    86
    19
    18
    Male
    Yes it looks like TIF_MM_RELEASED has to be set some steps before but i don't find information wich file could do it i take a look at some exic.c files from other kernel but it is not declared in this file so it must be another file
     
  5. Haubitze88

    Haubitze88Members

    Apr 4, 2013
    86
    19
    18
    Male
    ok so far so good but now my kernel compiles something like 2 minutes with make -j8
    and i got something like this
     
  6. Haubitze88

    Haubitze88Members

    Apr 4, 2013
    86
    19
    18
    Male
    CHK include/linux/version.h
    CHK include/generated/utsrelease.h
    make[1]: `include/generated/mach-types.h' is up to date.
    CALL scripts/checksyscalls.sh
    CHK include/generated/compile.h
    CC drivers/gpu/msm2/kgsl_trace.o
    In file included from include/trace/define_trace.h:86:0,
    from drivers/gpu/msm2/kgsl_trace.h:832,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    drivers/gpu/msm/./kgsl_trace.h: In function 'ftrace_test_probe_kgsl_issueibcmds':
    include/trace/ftrace.h:526:9: warning: passing argument 1 of 'check_trace_callback_type_kgsl_issueibcmds' from incompatible pointer type [enabled by default]
    struct ring_buffer *buffer; \
    ^
    include/trace/ftrace.h:33:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(name, \
    ^
    drivers/gpu/msm/./kgsl_trace.h:36:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_issueibcmds,
    ^
    In file included from drivers/gpu/msm2/kgsl_trace.h:24:0,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    include/linux/tracepoint.h:177:2: note: expected 'void (*)(void *, struct kgsl_device *, int, struct kgsl_cmdbatch *, int, int, int, unsigned int)' but argument is of type 'void (*)(void *, struct kgsl_device *, int, struct kgsl_ibdesc *, int, int, int, int, unsigned int)'
    check_trace_callback_type_##name(void (*cb)(data_proto)) \
    ^
    include/linux/tracepoint.h:251:3: note: in expansion of macro '__DECLARE_TRACE'
    __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
    ^
    include/linux/tracepoint.h:381:2: note: in expansion of macro 'DECLARE_TRACE'
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^
    drivers/gpu/msm2/kgsl_trace.h:36:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_issueibcmds,
    ^
    In file included from include/trace/define_trace.h:86:0,
    from drivers/gpu/msm2/kgsl_trace.h:832,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    drivers/gpu/msm/./kgsl_trace.h: In function 'ftrace_test_probe_kgsl_mpdcvs':
    include/trace/ftrace.h:526:9: error: implicit declaration of function 'check_trace_callback_type_kgsl_mpdcvs' [-Werror=implicit-function-declaration]
    struct ring_buffer *buffer; \
    ^
    include/trace/ftrace.h:33:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(name, \
    ^
    drivers/gpu/msm/./kgsl_trace.h:265:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_mpdcvs,
    ^
    drivers/gpu/msm/./kgsl_trace.h: In function 'ftrace_test_probe_kgsl_register_event':
    include/trace/ftrace.h:526:9: warning: passing argument 1 of 'check_trace_callback_type_kgsl_register_event' from incompatible pointer type [enabled by default]
    struct ring_buffer *buffer; \
    ^
    include/trace/ftrace.h:33:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(name, \
    ^
    drivers/gpu/msm/./kgsl_trace.h:622:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_register_event,
    ^
    In file included from drivers/gpu/msm2/kgsl_trace.h:24:0,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    include/linux/tracepoint.h:177:2: note: expected 'void (*)(void *, unsigned int, unsigned int, void *)' but argument is of type 'void (*)(void *, unsigned int, unsigned int)'
    check_trace_callback_type_##name(void (*cb)(data_proto)) \
    ^
    include/linux/tracepoint.h:251:3: note: in expansion of macro '__DECLARE_TRACE'
    __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
    ^
    include/linux/tracepoint.h:381:2: note: in expansion of macro 'DECLARE_TRACE'
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^
    drivers/gpu/msm2/kgsl_trace.h:762:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_register_event,
    ^
    In file included from include/trace/define_trace.h:86:0,
    from drivers/gpu/msm2/kgsl_trace.h:832,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    drivers/gpu/msm/./kgsl_trace.h: In function 'ftrace_test_probe_kgsl_fire_event':
    include/trace/ftrace.h:526:9: warning: passing argument 1 of 'check_trace_callback_type_kgsl_fire_event' from incompatible pointer type [enabled by default]
    struct ring_buffer *buffer; \
    ^
    include/trace/ftrace.h:33:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(name, \
    ^
    drivers/gpu/msm/./kgsl_trace.h:638:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_fire_event,
    ^
    In file included from drivers/gpu/msm2/kgsl_trace.h:24:0,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    include/linux/tracepoint.h:177:2: note: expected 'void (*)(void *, unsigned int, unsigned int, unsigned int, unsigned int, void *)' but argument is of type 'void (*)(void *, unsigned int, unsigned int, unsigned int, unsigned int)'
    check_trace_callback_type_##name(void (*cb)(data_proto)) \
    ^
    include/linux/tracepoint.h:251:3: note: in expansion of macro '__DECLARE_TRACE'
    __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
    ^
    include/linux/tracepoint.h:381:2: note: in expansion of macro 'DECLARE_TRACE'
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^
    drivers/gpu/msm2/kgsl_trace.h:780:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_fire_event,
    ^
    In file included from include/trace/define_trace.h:86:0,
    from drivers/gpu/msm2/kgsl_trace.h:832,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    drivers/gpu/msm/./kgsl_trace.h: In function 'perf_test_probe_kgsl_issueibcmds':
    include/trace/ftrace.h:747:18: warning: passing argument 1 of 'check_trace_callback_type_kgsl_issueibcmds' from incompatible pointer type [enabled by default]
    entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
    ^
    include/trace/ftrace.h:33:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(name, \
    ^
    drivers/gpu/msm/./kgsl_trace.h:36:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_issueibcmds,
    ^
    In file included from drivers/gpu/msm2/kgsl_trace.h:24:0,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    include/linux/tracepoint.h:177:2: note: expected 'void (*)(void *, struct kgsl_device *, int, struct kgsl_cmdbatch *, int, int, int, unsigned int)' but argument is of type 'void (*)(void *, struct kgsl_device *, int, struct kgsl_ibdesc *, int, int, int, int, unsigned int)'
    check_trace_callback_type_##name(void (*cb)(data_proto)) \
    ^
    include/linux/tracepoint.h:251:3: note: in expansion of macro '__DECLARE_TRACE'
    __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
    ^
    include/linux/tracepoint.h:381:2: note: in expansion of macro 'DECLARE_TRACE'
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^
    drivers/gpu/msm2/kgsl_trace.h:36:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_issueibcmds,
    ^
    In file included from include/trace/define_trace.h:86:0,
    from drivers/gpu/msm2/kgsl_trace.h:832,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    drivers/gpu/msm/./kgsl_trace.h: In function 'perf_test_probe_kgsl_register_event':
    include/trace/ftrace.h:747:18: warning: passing argument 1 of 'check_trace_callback_type_kgsl_register_event' from incompatible pointer type [enabled by default]
    entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
    ^
    include/trace/ftrace.h:33:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(name, \
    ^
    drivers/gpu/msm/./kgsl_trace.h:622:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_register_event,
    ^
    In file included from drivers/gpu/msm2/kgsl_trace.h:24:0,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    include/linux/tracepoint.h:177:2: note: expected 'void (*)(void *, unsigned int, unsigned int, void *)' but argument is of type 'void (*)(void *, unsigned int, unsigned int)'
    check_trace_callback_type_##name(void (*cb)(data_proto)) \
    ^
    include/linux/tracepoint.h:251:3: note: in expansion of macro '__DECLARE_TRACE'
    __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
    ^
    include/linux/tracepoint.h:381:2: note: in expansion of macro 'DECLARE_TRACE'
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^
    drivers/gpu/msm2/kgsl_trace.h:762:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_register_event,
    ^
    In file included from include/trace/define_trace.h:86:0,
    from drivers/gpu/msm2/kgsl_trace.h:832,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    drivers/gpu/msm/./kgsl_trace.h: In function 'perf_test_probe_kgsl_fire_event':
    include/trace/ftrace.h:747:18: warning: passing argument 1 of 'check_trace_callback_type_kgsl_fire_event' from incompatible pointer type [enabled by default]
    entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
    ^
    include/trace/ftrace.h:33:2: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(name, \
    ^
    drivers/gpu/msm/./kgsl_trace.h:638:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_fire_event,
    ^
    In file included from drivers/gpu/msm2/kgsl_trace.h:24:0,
    from drivers/gpu/msm2/kgsl_trace.c:19:
    include/linux/tracepoint.h:177:2: note: expected 'void (*)(void *, unsigned int, unsigned int, unsigned int, unsigned int, void *)' but argument is of type 'void (*)(void *, unsigned int, unsigned int, unsigned int, unsigned int)'
    check_trace_callback_type_##name(void (*cb)(data_proto)) \
    ^
    include/linux/tracepoint.h:251:3: note: in expansion of macro '__DECLARE_TRACE'
    __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
    ^
    include/linux/tracepoint.h:381:2: note: in expansion of macro 'DECLARE_TRACE'
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^
    drivers/gpu/msm2/kgsl_trace.h:780:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_fire_event,
    ^
    cc1: some warnings being treated as errors
    make[3]: *** [drivers/gpu/msm2/kgsl_trace.o] Error 1
    make[2]: *** [drivers/gpu/msm2] Error 2
    make[1]: *** [drivers/gpu] Error 2
    make: *** [drivers] Error 2
    haubitze@ubuntu:~/workspace/android/kernel/android_kernel_xiaomi_msm8960-android-5.1.1$
     
  7. Haubitze88

    Haubitze88Members

    Apr 4, 2013
    86
    19
    18
    Male
    i am not shure if just the last one

    drivers/gpu/msm2/kgsl_trace.h:780:1: note: in expansion of macro 'TRACE_EVENT'
    TRACE_EVENT(kgsl_fire_event, is the point the problem starts

    or maybe it is just something in this point

    drivers/gpu/msm/./kgsl_trace.h: In function 'ftrace_test_probe_kgsl_issueibcmds':
    include/trace/ftrace.h:526:9: warning: passing argument 1 of 'check_trace_callback_type_kgsl_issueibcmds' from incompatible pointer type [enabled by default]
    struct ring_buffer *buffer; \

    going to search for informations
     
  8. davfiala

    davfialaMembers

    Aug 20, 2013
    550
    199
    80
    Male
    Land Rover addict
    Czech Republic
    Well, we can't solve every bug during your trials of compilation. Learn more about this procedure and programing language, then try to compile kernels etc. You won't become dev in one week.
     
  9. you need the following two patches to compile ivan's kernel:
    Code:
    diff --git a/arch/arm/mach-msm/perf_trace_counters.h b/arch/arm/mach-msm/perf_trace_counters.h
    index c90593f..8cecd32 100644
    --- a/arch/arm/mach-msm/perf_trace_counters.h
    +++ b/arch/arm/mach-msm/perf_trace_counters.h
    @@ -158,7 +158,7 @@ TRACE_EVENT(sched_switch_with_ctrs,
    
    #endif
    #undef TRACE_INCLUDE_PATH
    -#define TRACE_INCLUDE_PATH .
    +#define TRACE_INCLUDE_PATH ../../arch/arm/mach-msm
    #define TRACE_INCLUDE_FILE perf_trace_counters
    #include <trace/define_trace.h>
    (this is a bug in ivan's kernel - I have no idea why this even works with out-of-tree compilation)
    Code:
    diff --git a/drivers/gpu/msm2/Makefile b/drivers/gpu/msm2/Makefile
    index a415037..82da024 100644
    --- a/drivers/gpu/msm2/Makefile
    +++ b/drivers/gpu/msm2/Makefile
    @@ -1,4 +1,4 @@
    -ccflags-y := -Iinclude/uapi/drm -Iinclude/drm -Idrivers/gpu/msm
    +ccflags-y := -Iinclude/uapi/drm -Iinclude/drm -Idrivers/gpu/msm2
    
    msm_kgsl_core-y = \
            kgsl.o \
     
    Haubitze88 and MSephiroth like this.
  10. Haubitze88

    Haubitze88Members

    Apr 4, 2013
    86
    19
    18
    Male
    Thanks for your reply
    When i saw that you start working on cm12.1 i just stopped trying to build Ivans kernel.
    Now i just compiled a cm11 kernel and adding some features just for fun and maybe if you have finished your hole rework on Ivans sourcecode i will try it again.
     

Share Our Site