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

help :undefined reference to __morestack #15

Open
b1gcat opened this issue May 4, 2016 · 6 comments
Open

help :undefined reference to __morestack #15

b1gcat opened this issue May 4, 2016 · 6 comments

Comments

@b1gcat
Copy link

b1gcat commented May 4, 2016

Hi sir,

I follow your tips to compile the gccgo successully, but something wrong happen after i use gccgo to compile hello world.

helloworld.go:(text+0x195): undefined reference to __morestack
Can you give me some hints to solve the problem?

@mkschreder
Copy link

Perhaps try -fsplit-stack?
On 4 May 2016 12:56, "zs" [email protected] wrote:

Hi sir,

I follow your tips to compile the gccgo successully, but something wrong
happen after i use gccgo to compile hello world.

helloworld.go:(text+0x195): undefined reference to __morestack
Can you give me some hints to solve the problem?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#15

@b1gcat
Copy link
Author

b1gcat commented May 4, 2016

@mkschreder
where should I put ' -fsplit-stack' ?
by the way I have enabled SSP_CONFIG, it that use split-stack default?

@mkschreder
Copy link

You would pass it as argument to gccgo when you compile your hello world
program. It may or may not solve your issue. If it does not then await
other replies.

On 4 May 2016 13:10, "zs" [email protected] wrote:

https://github.com/mkschreder
@mkschreder https://github.com/mkschreder
where should I put ' -fsplit-stack' ?
by the way I have enabled SSP_CONFIG, it that use split-stack default?


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#15 (comment)

@wongsyrone
Copy link

My old experience is to compile with debug info (the -g)and link libgo statically.

@b1gcat
Copy link
Author

b1gcat commented May 4, 2016

Thanks guys, I still cannot work it out.
Here is the details:

iamnot@IamNot-PC:~/openwrt/backup/chaos_calmer/test$ alias x86_gccgo='/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/bin/x86_64-openwrt-linux-gccgo -Wl,-R,/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/gcc/x86_64-openwrt-linux-gnu/4.8.3 -L /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib' iamnot@IamNot-PC:~/openwrt/backup/chaos_calmer/test$ ls^C iamnot@IamNot-PC:~/openwrt/backup/chaos_calmer/test$ x86_gccgo -o test test.go -static-libgox86_64-openwrt-linux-gccgo: warning: environment variable 'STAGING_DIR' not defined x86_64-openwrt-linux-gccgo: warning: environment variable 'STAGING_DIR' not defined /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionaddtls':
proc.c:(.text+0x12): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionmhelpgc':
proc.c:(.text+0x50): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionmspinning':
proc.c:(.text+0x78): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionUnlockOSThread':
proc.c:(.text+0x9d): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionmget':
proc.c:(.text+0xe6): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o):proc.c:(.text+0x11e): more undefined references to__morestack' follow
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_newosproc': proc.c:(.text+0x7f5): undefined reference to__wrap_pthread_create'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_gogo': proc.c:(.text+0x83a): undefined reference to__morestack'
proc.c:(.text+0x84b): undefined reference to __splitstack_setcontext' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionexecute':
proc.c:(.text+0x88a): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functiondoentersyscall':
proc.c:(.text+0x927): undefined reference to __splitstack_find' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functioncheckdead':
proc.c:(.text+0xa23): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functioninclocked':
proc.c:(.text+0xb46): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionstopm':
proc.c:(.text+0xb87): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functiongcstopm':
proc.c:(.text+0xc8f): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionprocresize':
proc.c:(.text+0xd12): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o):proc.c:(.text+0xf8c): more undefined references to__morestack' follow
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_mcall': proc.c:(.text+0xfd4): undefined reference to__splitstack_getcontext'
proc.c:(.text+0x101d): undefined reference to __splitstack_setcontext' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_setmg':
proc.c:(.text+0x1088): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_schedinit':
proc.c:(.text+0x10b5): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_goroutineheader':
proc.c:(.text+0x11c2): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_goroutinetrailer':
proc.c:(.text+0x123d): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_tracebackothers':
proc.c:(.text+0x12d0): undefined reference to __morestack' proc.c:(.text+0x13af): undefined reference to__splitstack_getcontext'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_gcprocs': proc.c:(.text+0x1428): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_helpgc': proc.c:(.text+0x1490): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_stoptheworld': proc.c:(.text+0x1541): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_needm': proc.c:(.text+0x164a): undefined reference to__morestack'
proc.c:(.text+0x16b2): undefined reference to __splitstack_getcontext' proc.c:(.text+0x1709): undefined reference to__splitstack_block_signals'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_dropm': proc.c:(.text+0x1727): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_park': proc.c:(.text+0x1791): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_gosched': proc.c:(.text+0x17d9): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_goexit': proc.c:(.text+0x17fa): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function kickoff': proc.c:(.text+0x181e): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o):proc.c:(.text+0x1885): more undefined references to __morestack' follow /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_malg':
proc.c:(.text+0x19e7): undefined reference to __splitstack_makecontext' proc.c:(.text+0x19fa): undefined reference to__splitstack_block_signals_context'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_allocm': proc.c:(.text+0x1a23): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function newm': proc.c:(.text+0x1abb): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function startm': proc.c:(.text+0x1b00): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function injectglist': proc.c:(.text+0x1bc0): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function handoffp': proc.c:(.text+0x1c3f): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o):proc.c:(.text+0x1d17): more undefined references to __morestack' follow /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_entersyscallblock':
proc.c:(.text+0x1fb4): undefined reference to __splitstack_find' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionwakep':
proc.c:(.text+0x201d): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_ready':
proc.c:(.text+0x2055): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionschedule':
proc.c:(.text+0x20d4): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionpark0':
proc.c:(.text+0x2484): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functiongosched0':
proc.c:(.text+0x2520): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o):proc.c:(.text+0x25a4): more undefined references to__morestack' follow
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function runtime_mstart': proc.c:(.text+0x2a24): undefined reference to__splitstack_getcontext'
proc.c:(.text+0x2a7b): undefined reference to __splitstack_block_signals' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime.entersyscall':
proc.c:(.text+0x2b0b): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime.exitsyscall':
proc.c:(.text+0x2b27): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In function__go_go':
proc.c:(.text+0x2b46): undefined reference to __morestack' proc.c:(.text+0x2bfb): undefined reference to__splitstack_resetcontext'
proc.c:(.text+0x2c0f): undefined reference to __splitstack_block_signals_context' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_Breakpoint':
proc.c:(.text+0x2d75): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime.Gosched':
proc.c:(.text+0x2d8e): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_gomaxprocsfunc':
proc.c:(.text+0x2dad): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime.LockOSThread':
proc.c:(.text+0x2e48): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o): In functionruntime_lockOSThread':
proc.c:(.text+0x2e87): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(proc.o):proc.c:(.text+0x2ec6): more undefined references to__morestack' follow
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(go-signal.o): In function sig_tramp_info': go-signal.c:(.text+0x2c6): undefined reference to__splitstack_getcontext'
go-signal.c:(.text+0x2db): undefined reference to __splitstack_setcontext' go-signal.c:(.text+0x2f8): undefined reference to__splitstack_setcontext'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(go-signal.o): In function runtime_setsig': go-signal.c:(.text+0x31e): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(go-signal.o): In function runtime_getsig': go-signal.c:(.text+0x3f9): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(go-signal.o): In function os.sigpipe': go-signal.c:(.text+0x493): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(go-signal.o): In function runtime_setprof': go-signal.c:(.text+0x50a): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(go-string-to-byte-array.o): In function __go_string_to_byte_array': go-string-to-byte-array.c:(.text+0x15): undefined reference to__morestack'
/home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(go-string-to-int-array.o):go-string-to-int-array.c:(.text+0x15): more undefined references to __morestack' follow /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(mgc0.o): In functionaddstackroots':
mgc0.c:(.text+0x1108): undefined reference to __splitstack_find' mgc0.c:(.text+0x116f): undefined reference to__splitstack_find_context'
mgc0.c:(.text+0x11c3): undefined reference to __splitstack_find' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(mgc0.o): In functioncachestats':
mgc0.c:(.text+0x1206): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(mgc0.o): In functiongc':
mgc0.c:(.text+0x12f9): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(mgc0.o): In function__go_register_gc_roots':
mgc0.c:(.text+0x19d7): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(mgc0.o): In functionruntime_memorydump':
mgc0.c:(.text+0x1a03): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(mgc0.o): In functionruntime_gchelper':
mgc0.c:(.text+0x1c03): undefined reference to __morestack' /home/iamnot/openwrt/backup/chaos_calmer/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.19/lib/libgo.a(mgc0.o):mgc0.c:(.text+0x1c8e): more undefined references to__morestack' follow
collect2: error: ld returned 1 exit status
`

@ajeecai
Copy link

ajeecai commented Jun 19, 2017

@zsdev2015 Hi, did you find out how to do with it? I encounter almost the same errors as the log you posted here.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants