You are not logged in.

#1 2015-12-18 07:53:45

Volle
Member
From: Stuttgart, Germany
Registered: 2013-12-05
Posts: 48

Error compiling Android 6 (mclinker)

Hey,

i'm getting an error compiling android 6 on my box. This happens while compiling cm13 or pac-6.0 (no others tested).
My system is up2date (no testing repo).
I think this might be related to flex (but is not the problem luca020400 fixed here https://bbs.archlinux.org/viewtopic.php?id=201281)

this is my error output:

host C++: libmcldSupport <= frameworks/compile/mclinker/lib/Support/Target.cpp
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:1507:8: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; did you mean to use '->'?
                        yyin.rdbuf(std::cin.rdbuf());
                        ~~~~^
                            ->
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:1510:9: error: member reference type 'std::ostream *' (aka 'basic_ostream<char> *') is a pointer; did you mean to use '->'?
                        yyout.rdbuf(std::cout.rdbuf());
                        ~~~~~^
                             ->
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2293:50: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; did you mean to use '->'?
                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf();
                                                                  ~~~~^
                                                                      ->
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2408:2: error: cannot initialize a member subobject of type 'std::istream *' (aka 'basic_istream<char> *') with an rvalue of type 'basic_streambuf<char_type, traits_type> *'
        yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
        ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2409:2: error: cannot initialize a member subobject of type 'std::ostream *' (aka 'basic_ostream<char> *') with an rvalue of type 'basic_streambuf<char_type, traits_type> *'
        yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
        ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2411:2: error: use of undeclared identifier 'ctor_common'
        ctor_common();
        ^
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2416:14: error: out-of-line definition of 'yyFlexLexer' does not match any declaration in 'yyFlexLexer'
yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ):
             ^~~~~~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:23:25: note: expanded from macro 'yyFlexLexer'
    #define yyFlexLexer yyFlexLexer
                        ^~~~~~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2407:27: note: type of 1st parameter of member declaration does not match definition ('std::istream *' (aka 'basic_istream<char> *') vs 'std::istream &' (aka 'basic_istream<char> &'))
yyFlexLexer::yyFlexLexer( FLEX_STD istream* arg_yyin, FLEX_STD ostream* arg_yyout ):
                          ^
frameworks/compile/mclinker/include/mcld/Script/FlexLexer.h:62:18: note: expanded from macro 'FLEX_STD'
#define FLEX_STD std::
                 ^
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2417:2: error: cannot initialize a member subobject of type 'std::istream *' (aka 'basic_istream<char> *') with an rvalue of type 'basic_streambuf<char_type, traits_type> *'
        yyin(arg_yyin.rdbuf()),
        ^    ~~~~~~~~~~~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2418:2: error: cannot initialize a member subobject of type 'std::ostream *' (aka 'basic_ostream<char> *') with an rvalue of type 'basic_streambuf<char_type, traits_type> *'
        yyout(arg_yyout.rdbuf())
        ^     ~~~~~~~~~~~~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2420:2: error: use of undeclared identifier 'ctor_common'
        ctor_common();
        ^
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2425:19: error: out-of-line definition of 'ctor_common' does not match any declaration in 'yyFlexLexer'
void yyFlexLexer::ctor_common()
                  ^~~~~~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2463:19: error: out-of-line definition of 'switch_streams' does not match any declaration in 'yyFlexLexer'
void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out )
                  ^~~~~~~~~~~~~~
frameworks/compile/mclinker/include/mcld/Script/FlexLexer.h:133:31: note: type of 1st parameter of member declaration does not match definition ('std::istream *' (aka 'basic_istream<char> *') vs 'std::istream &' (aka 'basic_istream<char> &'))
  virtual void switch_streams(FLEX_STD istream* new_in,
                              ^
frameworks/compile/mclinker/include/mcld/Script/FlexLexer.h:62:18: note: expanded from macro 'FLEX_STD'
#define FLEX_STD std::
                 ^
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2467:41: error: no viable conversion from 'std::istream' (aka 'basic_istream<char>') to 'std::istream *' (aka 'basic_istream<char> *')
        yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE  ) );
                                               ^~~~~~
frameworks/compile/mclinker/include/mcld/Script/FlexLexer.h:125:62: note: passing argument to parameter 's' here
  struct yy_buffer_state* yy_create_buffer(FLEX_STD istream* s, int size);
                                                             ^
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2470:7: error: member reference type 'std::ostream *' (aka 'basic_ostream<char> *') is a pointer; did you mean to use '->'?
        yyout.rdbuf(new_out.rdbuf());
        ~~~~~^
             ->
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2478:10: error: assigning to 'std::istream *' (aka 'basic_istream<char> *') from incompatible type 'std::istream **' (aka 'basic_istream<char> **'); remove &
                new_in = &yyin;
                       ^ ~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2482:11: error: assigning to 'std::ostream *' (aka 'basic_ostream<char> *') from incompatible type 'std::ostream **' (aka 'basic_ostream<char> **'); remove &
                new_out = &yyout;
                        ^ ~~~~~~
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2494:11: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; did you mean to use '->'?
        if ( yyin.eof() || yyin.fail() )
             ~~~~^
                 ->
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2494:25: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; did you mean to use '->'?
        if ( yyin.eof() || yyin.fail() )
                           ~~~~^
                               ->
/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.cpp:2509:13: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; did you mean to use '->'?
        (void) yyin.read( buf, max_size );
               ~~~~^
                   ->
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
build/core/binary.mk:662: recipe for target '/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.o' failed
make: *** [/mnt/data/pac-private/pac60/out/host/linux-x86/obj/STATIC_LIBRARIES/libmcldScript_intermediates/ScriptScanner.o] Error 1
make: *** Waiting for unfinished jobs....
host C++: libmcldSupport <= frameworks/compile/mclinker/lib/Support/TargetRegistry.cpp
make: *** wait: No child processes.  Stop.

#### make failed to build some targets (08:45 (mm:ss)) ####

this is the part of code where it fails:
ScriptScanner.cpp:1507

/** The main scanner function which does all the work.
 */
YY_DECL
{
        yy_state_type yy_current_state;
        char *yy_cp, *yy_bp;
        int yy_act;

        if ( !(yy_init) )
                {
                (yy_init) = 1;

#ifdef YY_USER_INIT
                YY_USER_INIT;
#endif

                if ( ! (yy_start) )
                        (yy_start) = 1; /* first start state */

                if ( ! yyin )
                        yyin.rdbuf(std::cin.rdbuf());

                if ( ! yyout )
                        yyout.rdbuf(std::cout.rdbuf());

                if ( ! YY_CURRENT_BUFFER ) {
                        yyensure_buffer_stack ();
                        YY_CURRENT_BUFFER_LVALUE =
                                yy_create_buffer( yyin, YY_BUF_SIZE );
                }

                yy_load_buffer_state(  );
                }

        {
#line 55 "frameworks/compile/mclinker/lib/Script/ScriptScanner.ll"

ScriptScanner.cpp:2293

                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
                        {
                        /* We're scanning a new file or input source.  It's
                         * possible that this happened because the user
                         * just pointed yyin at a new source and called
                         * yylex().  If so, then we have to assure
                         * consistency between YY_CURRENT_BUFFER and our
                         * globals.  Here is the right place to do so, because
                         * this is the first action (other than possibly a
                         * back-up) that will match for the new input source.
                         */
                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf();
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
                        }

ScriptScanner.cpp:2408

/* The contents of this function are C++ specific, so the () macro is not used.
 * This constructor simply maintains backward compatibility.
 * DEPRECATED
 */
yyFlexLexer::yyFlexLexer( FLEX_STD istream* arg_yyin, FLEX_STD ostream* arg_yyout ):
        yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
        yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
{
        ctor_common();
}

/* The contents of this function are C++ specific, so the () macro is not used.
 */
yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ):
        yyin(arg_yyin.rdbuf()),
        yyout(arg_yyout.rdbuf())
{
        ctor_common();
}

my flex version is

[volle@volle-pc pac60]$ flex -V
flex 2.6.0

I'm not sure its flex related, its just a wild guess but since we had some flex problems before on arch with building android and some of those errors just look like problems with flex.
Does anyone get the same errors and/or has a fix/idea?

Offline

#2 2016-02-06 21:19:24

friederbluemle
Member
From: Singapore
Registered: 2016-01-25
Posts: 2

Re: Error compiling Android 6 (mclinker)

Did you find a solution for this? I am having the same issue now. I am also using the system flex version 2.6.0 (vs. the older version from prebuilts that does not work with a newer glibc version).

Offline

#3 2016-02-07 10:11:59

Volle
Member
From: Stuttgart, Germany
Registered: 2013-12-05
Posts: 48

Re: Error compiling Android 6 (mclinker)

No,  I haven't  found a solution yet.
My workaround is to remove the mclinker dir completely.  Since I have no idea what it is for and it doesn't  seem to break the rom I'm OK with that for the time being..
I'm  glad I'm not the only one with this problem ;-)

Offline

#4 2018-05-11 08:28:12

justin_wu
Member
Registered: 2017-11-16
Posts: 9

Re: Error compiling Android 6 (mclinker)

I am meet this problem, too.
and search frome web, find the solution.
https://github.com/hadolint/hadolint/issues/173

the build process must use prebuilts/misc/linux-x86/flex/flex-2.5.39.
not use /usr/bin/flex

Last edited by justin_wu (2018-05-11 08:31:04)

Offline

#5 2018-05-11 08:40:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Error compiling Android 6 (mclinker)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB