Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
36 user(s) are online (30 user(s) are browsing Forum)

Members: 0
Guests: 36

more...


Browsing this Thread:   1 Anonymous Users




(1) 2 3 4 ... 6 »


Re: a more modern gcc?
#52
Home away from home
Home away from home


See User information
Quote:

DizzyOfCRN wrote:
Quote:

Kalamatee wrote:
Quote:

Kalamatee wrote:
Quote:

simplex wrote:
I looked up the <tt>ucontext.h</tt> source and I think maybe you meant that I should change it to <tt>struct ucontext_t</tt>. I made that change and I?'ll update the moment I know something.



no, ucontext_t should be a typedef of type struct xxxx.




I would be interested to see the contents of your ucontext.h - could you perhaps email it to me at kalamatee@gmail.com

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 */


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
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#51
Home away from home
Home away from home


See User information
Quote:

Kalamatee wrote:
Quote:

Kalamatee wrote:
Quote:

simplex wrote:
I looked up the <tt>ucontext.h</tt> source and I think maybe you meant that I should change it to <tt>struct ucontext_t</tt>. I made that change and I?'ll update the moment I know something.



no, ucontext_t should be a typedef of type struct xxxx.




I would be interested to see the contents of your ucontext.h - could you perhaps email it to me at kalamatee@gmail.com

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
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#50
Home away from home
Home away from home


See User information
Quote:

Kalamatee wrote:
Quote:

simplex wrote:
I looked up the <tt>ucontext.h</tt> source and I think maybe you meant that I should change it to <tt>struct ucontext_t</tt>. I made that change and I’'ll update the moment I know something.



no, ucontext_t should be a typedef of type struct xxxx.




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
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#49
Home away from home
Home away from home


See User information
Quote:

wawa wrote:
Quote:

Kalamatee wrote:
... there should be rules in the build system to re-create the patch for gcc after the modification but im not 100% sure offhand.


would be great if they were, its pita, these diffs, but i can fix it and make a patch tomorrow, by hand.. errm by diff and commit it if its desirable.


Edit the code where it is extracted as part of building, then once modified issue "make crosstools-gcc-create-patch"

It will move your existing source to a tmp dir, extract the sources again and diff the results into a new file.



Posted on: 2018/4/18 14:49
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#48
Quite a regular
Quite a regular


See User information
Quote:

Kalamatee wrote:

try adding -static-libstdc++.

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
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#47
Home away from home
Home away from home


See User information
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
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#46
Home away from home
Home away from home


See User information
Quote:

simplex wrote:
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.


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

MY_SOURCES := sourcefile_a sourcefile_b

%build_prog mmake=my-projects-meta-target files=$(MY_SOURCES)


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
Resized Image
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#45
Quite a regular
Quite a regular


See User information
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.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#44
Home away from home
Home away from home


See User information
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
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: a more modern gcc?
#43
Home away from home
Home away from home


See User information
Quote:

simplex wrote:
Now it failed on not finding <tt>Xcursor.h</tt>. Found and installed the Fedora package for that, continuing?


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
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




(1) 2 3 4 ... 6 »



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.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project