Browsing this Thread:
1 Anonymous Users
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
I think we need to adjust the used ucontext.h ("ucontext.h" or "sys/ucontext.h") depending on host, and query which in the top level configure. From what ive seen and read, "ucontext_t" _is_ the correct type specifier to use (not struct ucontext_t), since the actual structure type could have different name depending on host (ucontext, ucontext_t or unnamed on some..), but it depends on including the correct header to get the definition. sys/uncontext.h is meant to be deprecated according to POSIX.1-2008, and may not exist on some systems.
Posted on: 2018/4/20 18:13
|
|||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
Quote:
Thanks for fixing the AROS build with newer gcc! Here's my ucontext relevant part in sys/ucontext.h: /* Userlevel context. */ typedef struct ucontext_t { unsigned long int uc_flags; struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; Definition is the same for __x86_64__ and !__x86_64__ [dizzy@linux include]$ grep -r "ucontext" * asm/ucontext.h: * layout pointed by the fpstate pointer in the ucontext's sigcontext asm/ucontext.h:#include <asm-generic/ucontext.h> asm-generic/ucontext.h:struct ucontext { asm-generic/ucontext.h: struct ucontext *uc_link; rdma/cxgb4-abi.h:struct c4iw_alloc_ucontext_resp { rdma/mlx5-abi.h:struct mlx5_ib_alloc_ucontext_req { rdma/mlx5-abi.h:struct mlx5_ib_alloc_ucontext_req_v2 { rdma/mlx5-abi.h:enum mlx5_ib_alloc_ucontext_resp_mask { rdma/mlx5-abi.h:struct mlx5_ib_alloc_ucontext_resp { rdma/qedr-abi.h:struct qedr_alloc_ucontext_resp { rdma/mthca-abi.h:struct mthca_alloc_ucontext_resp { rdma/vmw_pvrdma-abi.h:struct pvrdma_alloc_ucontext_resp { rdma/hns-abi.h:struct hns_roce_ib_alloc_ucontext_resp { rdma/ocrdma-abi.h:struct ocrdma_alloc_ucontext_resp { rdma/nes-abi.h:struct nes_alloc_ucontext_req { rdma/nes-abi.h:struct nes_alloc_ucontext_resp { rdma/mlx4-abi.h:struct mlx4_ib_alloc_ucontext_resp_v3 { rdma/mlx4-abi.h:struct mlx4_ib_alloc_ucontext_resp { signal.h:/* This will define `ucontext_t' and `mcontext_t'. */ signal.h:# include <sys/ucontext.h> sys/ucontext.h:typedef struct ucontext_t sys/ucontext.h: struct ucontext_t *uc_link; sys/ucontext.h: } ucontext_t; sys/ucontext.h:typedef struct ucontext_t sys/ucontext.h: struct ucontext_t *uc_link; sys/ucontext.h: } ucontext_t; sys/ucontext.h:#endif /* sys/ucontext.h */ ucontext.h:#include <sys/ucontext.h> ucontext.h:extern int getcontext (ucontext_t *__ucp) __THROWNL; ucontext.h:extern int setcontext (const ucontext_t *__ucp) __THROWNL; ucontext.h:extern int swapcontext (ucontext_t *__restrict __oucp, ucontext.h: const ucontext_t *__restrict __ucp) __THROWNL; ucontext.h:extern void makecontext (ucontext_t *__ucp, void (*__func) (void), ucontext.h:#endif /* ucontext.h */
Posted on: 2018/4/20 5:48
|
|||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
I would be interested to see the contents of your ucontext.h - could you perhaps email it to me at kalamatee@gmail.com
Posted on: 2018/4/18 14:50
|
|||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Quite a regular
![]() |
Quote:
That did the trick. Thanks! Quote: You will want to look into using a mmakefile.src at some point to simplify building, since it will then use the build system and make sure the correct flags etc are used to compile the code. OK. I’m used to makefiles, so hopefully that won’t be a problem.
Posted on: 2018/4/10 2:48
|
|||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Just a heads up: we might have a c++11 capable compiler but some things are not enabled. Our stdc implementation is missing stuff so the c++11 math features for instance (e.g in the std:: namespace) will be missing. Also some AROS/AmigaOS headers still need fixes for use in c++ code, but quite a bit should already be usable.
Posted on: 2018/4/9 23:52
|
|||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
try adding -static-libstdc++. AROS doesnt (yet) have a shared libstdc++ implementation, and the compiler needs to know we are staticaly linking so that it can link in the necessary support (pthreads). You will want to look into using a mmakefile.src at some point to simplify building, since it will then use the build system and make sure the correct flags etc are used to compile the code. Theres plenty of examples for small single file projects, and c++ projects so it should be easy to see how to make one work and get familiar. They are generaly of the form
#MM my-projects-meta-target : some-prequisite-meta-target
and make it with "make my-projects-meta-target" from the top level AROS build directory. .. Though you will need to check the actual macro invocation format ..
Posted on: 2018/4/9 23:26
|
|||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Quite a regular
![]() |
The changes I made above got me a successful compile (including the change to <tt>struct ucontext_t</tt>). I can start AROS hosted and replicate previous bugs.
![]() Unfortunately I still can?t compile a C++ program. This is probably on me but here is what I?ve done: 1) Created a <tt>local</tt> directory in the AROS tree. 2) Wrote a simple <tt>hello.cxx</tt> file. 3) Invoked <tt>x86_64-aros-g++ hello.cxx</tt>. Now I get a linker error; stuff like: <pre style="margin-left:10%;margin-right=10%;background-color:#ddeeff;"><tt>There are undefined symbols in 'a.out': U pthread_cond_broadcast /home/cantanima/Downloads/AROS-20180326-source/bin/linux-x86_64/gen/host/tools/crosstools/gcc/x86_64-aros/libstdc++-v3/include/x86_64-aros/bits/gthr-default.h:852 U pthread_cond_destroy /home/cantanima/Downloads/AROS-20180326-source/bin/linux-x86_64/gen/host/tools/crosstools/gcc/x86_64-aros/libstdc++-v3/include/x86_64-aros/bits/gthr-default.h:884 </tt></pre> …and more along those lines. I?m a bit involved with my own work at the moment, but I?m quite sure I can work this out on my own at a later time; it?s obviously a matter of finding the directory containing the object files. I’d probably have this issue in C, too. That said, if anyone knows what the issue is, I won?t mind if they tell. ![]()
Posted on: 2018/4/9 23:04
|
|||
|
Programming is a pursuit in which an unintelligent machine demonstrates conclusively to intelligent people just what fools they are. Do you think that you are a clever person? Take up programming, and the computer will quickly disabuse you of this notion.
|
||||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
unfortunately it seems my old instructions building aros m68k and x86 got deleted, amigaforum.de points now to apollo forum or such. but then they were outdated at best.
the problem you have indicates you almost did it imho. read http://aros.sourceforge.net/documentation/developers/compiling.php especially configuring, you may need to enable --enable-x11-shm or the like, depends on your host i guess. but it will be easy to solve.
Posted on: 2018/4/9 22:11
|
|||
|
||||
|
Re: a more modern gcc?
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
Quote:
you need to locate package that contains this x header on your host and install it. i could look up some very old configure invokes i needed, they are mentioned in build instructions on aros site, today i dont bother, dont ask me why. perhaps sdl is enough.
Posted on: 2018/4/9 22:01
|
|||
|
||||
You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.









