Issue410

Title undefined reference to *context
Priority bug Status resolved
Superseder Nosy List jjisnow
Assigned To Keywords

Created on 2018-08-07.09:53:49 by jjisnow, last changed by kayhayen.

Messages
msg2517 (view) Author: jjisnow Date: 2018-08-24.05:16:26
Thanks a bunch Kay!

On Fri, 24 Aug. 2018, 7:33 am Kay Hayen (via Issue Tracker), <
issue_tracker@nuitka.net> wrote:

>
> Kay Hayen <kay.hayen@gmail.com> added the comment:
>
> I am pushing to develop a stable version of goto generators later today.
> Posting
> now, so I do not forget. You need 0.5.33rc7 or higher.
>
> Generators are now roughly twice as fast, plus Android shouldn't have that
> linker issue.
>
> Closing now, so I do not forget.
>
> Yours,
> Kay
>
> ----------
> status: testing -> resolved
>
> _______________________________________________
> Nuitka issue tracker <issue_tracker@nuitka.net>
> <http://bugs.nuitka.net/issue410>
> _______________________________________________
>
msg2484 (view) Author: kayhayen Date: 2018-08-23.21:33:06
I am pushing to develop a stable version of goto generators later today. Posting 
now, so I do not forget. You need 0.5.33rc7 or higher.

Generators are now roughly twice as fast, plus Android shouldn't have that 
linker issue.

Closing now, so I do not forget.

Yours,
Kay
msg2483 (view) Author: jjisnow Date: 2018-08-16.11:03:18
This is the error stream from a python 3.6 install:

t.build/CompiledGeneratorType.c:1389:24: error: 'struct
Nuitka_GeneratorObject' has no member named 'm_yielded'; did you mean
'm_yieldfrom'?
             generator->m_yielded = retval;
                        ^~~~~~~~~
                        m_yieldfrom
test.build/CompiledGeneratorType.c:1421:36: error: 'struct
Nuitka_GeneratorObject' has no member named 'm_yielder_context'; did you
mean 'm_yieldfrom'?
             swapFiber( &generator->m_yielder_context,
&generator->m_caller_context );
                                    ^~~~~~~~~~~~~~~~~
                                    m_yieldfrom
test.build/CompiledGeneratorType.c:1421:67: error: 'struct
Nuitka_GeneratorObject' has no member named 'm_caller_context'; did you
mean 'm_code_object'?
             swapFiber( &generator->m_yielder_context,
&generator->m_caller_context );

 ^~~~~~~~~~~~~~~~

 m_code_object
test.build/CompiledGeneratorType.c:1453:37: error: 'struct
Nuitka_GeneratorObject' has no member named 'm_yielded'; did you mean
'm_yieldfrom'?
             send_value = generator->m_yielded;
                                     ^~~~~~~~~
                                     m_yieldfrom
scons: *** [test.build/CompiledGeneratorType.o] Error 1

On 16 Aug. 2018 7:19 pm, "Kay Hayen (via Issue Tracker)" <
issue_tracker@nuitka.net> wrote:

Kay Hayen <kay.hayen@gmail.com> added the comment:

If you are daring and using Python 3.4 or earlier, you can use factory
branch with --experimental=generator_heap --
experimental=generator_goto flags, and it should work.

On 3.5 (coroutines) and later 3.6 (asyncgen) I will be working later.

Yours,
Kay

----------
status: chatting -> testing

_______________________________________________
Nuitka issue tracker <issue_tracker@nuitka.net>
<http://bugs.nuitka.net/issue410>
_______________________________________________
msg2482 (view) Author: kayhayen Date: 2018-08-16.09:19:27
If you are daring and using Python 3.4 or earlier, you can use factory branch with --experimental=generator_heap --
experimental=generator_goto flags, and it should work.

On 3.5 (coroutines) and later 3.6 (asyncgen) I will be working later.

Yours,
Kay
msg2461 (view) Author: jjisnow Date: 2018-08-07.13:24:25
This is on an Android 7 os. Termux app
msg2460 (view) Author: kayhayen Date: 2018-08-07.10:12:40
What platform is this on?


Yours,
Kay
msg2459 (view) Author: jjisnow Date: 2018-08-07.09:53:49
int res = getcontext( &to->f_context );
               ^~~~~~~~~~
               getopt
test.build/fibers_gen.c:50:5: warning: implicit 
declaration of function 'makecontext' [-
Wimplicit-function-declaration]
     makecontext( &to->f_context, (void (*)
())code, 1, (unsigned long)arg );
     ^~~~~~~~~~~
test.build/fibers_gen.c: In function 
'_swapFiber':
test.build/fibers_gen.c:74:15: warning: 
implicit declaration of function 'swapcontext' 
[-Wimplicit-function-declaration]
     int res = swapcontext( &to->f_context, 
&from->f_context );
               ^~~~~~~~~~~
/data/data/com.termux/files/usr/bin/ld: 
test.build/fibers_gen.o: in function 
`_prepareFiber':
fibers_gen.c:(.text+0x24): undefined reference 
to `getcontext'
/data/data/com.termux/files/usr/bin/ld: 
fibers_gen.c:(.text+0x6c): undefined reference 
to `makecontext'
/data/data/com.termux/files/usr/bin/ld: 
test.build/fibers_gen.o: in function 
`_swapFiber':
fibers_gen.c:(.text+0xf0): undefined reference 
to `swapcontext'
collect2: error: ld returned 1 exit status
scons: *** [test.exe] Error 1

This is an error using gcc-8 installed on 
Termux on an android device attempting to 
compile using the command:
python -m nuitka test.py

test.py's contents are:

    print('hello world!')
History
Date User Action Args
2018-08-24 18:16:06kayhayensetstatus: chatting -> resolved
2018-08-24 05:16:26jjisnowsetstatus: resolved -> chatting
messages: + msg2517
2018-08-23 21:33:07kayhayensetstatus: testing -> resolved
messages: + msg2484
2018-08-16 11:03:18jjisnowsetmessages: + msg2483
2018-08-16 09:19:27kayhayensetstatus: chatting -> testing
messages: + msg2482
2018-08-07 13:24:25jjisnowsetmessages: + msg2461
2018-08-07 10:12:40kayhayensetstatus: unread -> chatting
messages: + msg2460
2018-08-07 09:53:49jjisnowcreate