Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Can't link to pthread and sed. #106

Open
tema3210 opened this issue Mar 26, 2019 · 6 comments
Open

Can't link to pthread and sed. #106

tema3210 opened this issue Mar 26, 2019 · 6 comments

Comments

@tema3210
Copy link

tema3210 commented Mar 26, 2019

tema3210@tema2-devhost:~/unigo$` x86_64-hermit-gccgo main.go -o main /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/lib/libgo.a(proc.o): in function `runtime_newosproc': /work/build/x86_64-hermit/libgo/../../../libgo/runtime/proc.c:202: undefined reference to `pthread_attr_init' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgo/../../../libgo/runtime/proc.c:204: undefined reference to `pthread_attr_setdetachstate' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgo/../../../libgo/runtime/proc.c:218: undefined reference to `pthread_create' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/lib/libgo.a(thread-sema.o): in function `runtime_semacreate': /work/build/x86_64-hermit/libgo/../../../libgo/runtime/thread-sema.c:40: undefined reference to `sem_init' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/lib/libgo.a(thread-sema.o): in function `runtime_semasleep': /work/build/x86_64-hermit/libgo/../../../libgo/runtime/thread-sema.c:77: undefined reference to `sem_timedwait' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgo/../../../libgo/runtime/thread-sema.c:107: undefined reference to `sem_wait' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/lib/libgo.a(thread-sema.o): in function `runtime_semawakeup': /work/build/x86_64-hermit/libgo/../../../libgo/runtime/thread-sema.c:125: undefined reference to `sem_post' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/lib/libgo.a(go-cgo.o): in function `_cgo_wait_runtime_init_done': /work/build/x86_64-hermit/libgo/../../../libgo/runtime/go-cgo.c:216: undefined reference to `pthread_mutex_lock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgo/../../../libgo/runtime/go-cgo.c:221: undefined reference to `pthread_cond_wait' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgo/../../../libgo/runtime/go-cgo.c:225: undefined reference to `pthread_mutex_unlock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/lib/libgo.a(go-cgo.o): in function `_cgo_notify_runtime_init_done': /work/build/x86_64-hermit/libgo/../../../libgo/runtime/go-cgo.c:238: undefined reference to `pthread_mutex_lock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgo/../../../libgo/runtime/go-cgo.c:242: undefined reference to `pthread_cond_broadcast' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgo/../../../libgo/runtime/go-cgo.c:245: undefined reference to `pthread_mutex_unlock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/libgcc.a(unwind-dw2-fde.o): in function `__gthread_mutex_lock': /work/build/x86_64-hermit/libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/libgcc.a(unwind-dw2-fde.o): in function `__gthread_mutex_unlock': /work/build/x86_64-hermit/libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/libgcc.a(unwind-dw2-fde.o): in function `__gthread_mutex_lock': /work/build/x86_64-hermit/libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/libgcc.a(unwind-dw2-fde.o): in function `__gthread_mutex_unlock': /work/build/x86_64-hermit/libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock' /opt/hermit/lib/gcc/x86_64-hermit/6.3.0/../../../../x86_64-hermit/bin/ld: /work/build/x86_64-hermit/libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock' collect2: error: ld returned 1 exit status tema3210@tema2-devhost:~/unigo$

Such thing i've encouter by running hermits gccgo, it seems it didn't compiled these, suggest adding pthread and\or sed mirrors in include, or write manual how to do it manually, please.

@stlankes
Copy link
Contributor

How do you install HermitCore? Do you find the program pi in /opt/hermit/x86_64-hermit/extra/tests? Does it run?

@tema3210
Copy link
Author

tema3210 commented Apr 1, 2019

How do you install HermitCore? Do you find the program pi in /opt/hermit/x86_64-hermit/extra/tests? Does it run?

I installed toolchain via deb from tutorial,then i built hermit from sources, installed via 'sudo make install'. The 'pi' from '/opt/hermit/x86_64-hermit/extra/tests' runs normally

@stlankes
Copy link
Contributor

stlankes commented Apr 3, 2019

Hm, which Linux distribution do you use?

@stlankes
Copy link
Contributor

stlankes commented Apr 6, 2019

Does C compiler work?

@tema3210
Copy link
Author

tema3210 commented Apr 6, 2019

C compiler work, I use lubuntu 17.04

@stlankes
Copy link
Contributor

stlankes commented Jan 1, 2020

Please link the linpthread to your example.

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

No branches or pull requests

2 participants