libevent/tmux for IRIX

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
Raion-Fox
Donor
Donor
Posts: 1129
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

libevent/tmux for IRIX

Unread postby Raion-Fox » Thu Jan 19, 2017 12:46 pm

I'd like to see if I can do a port of libevent/tmux to IRIX but unfortunately reimu, my Fuel, is apart for diagnosis and repair.

Does anyone have a system they could let me SSH into for development until I get my system back online? I'll be sure to return the favor. PM me since I want to give us a good alternative to screen.
:O3x02L: R16000 700Mhz 8GB RAM kanna
:Octane:
:Indy: (Acclaim) R4600 133MHz 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R12000SC 300MHz 192MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.7GHz 2GB RAM kasha

User avatar
Krokodil
Donor
Donor
Posts: 438
Joined: Fri Apr 17, 2015 2:32 pm
Location: The House of Particular Individuals

Re: libevent/tmux for IRIX

Unread postby Krokodil » Thu Jan 19, 2017 3:30 pm

What kind of power do you need to do the development?
:Octane2: - :O2: - :Octane: - :Indigo2IMP:

User avatar
Raion-Fox
Donor
Donor
Posts: 1129
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

Re: libevent/tmux for IRIX

Unread postby Raion-Fox » Thu Jan 19, 2017 4:24 pm

Just a system with both GCC and MIPSPro would be fine and at least 1GB of RAM - and swap space of course in case the disk swaps out. Libevent and tmux aren't exactly that taxing to try and build. I'll ensure I can get them to build, I'll issue any patches and let someone incorporate them into Nekoware.
:O3x02L: R16000 700Mhz 8GB RAM kanna
:Octane:
:Indy: (Acclaim) R4600 133MHz 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R12000SC 300MHz 192MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.7GHz 2GB RAM kasha

User avatar
Raion-Fox
Donor
Donor
Posts: 1129
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

Re: libevent/tmux for IRIX

Unread postby Raion-Fox » Sun Jan 29, 2017 9:54 pm

Libevent 2.1 stable builds fine with gmake, coreutils, and binutils installed as dependencies. It requires no codepatching.

The problem with tmux is that err.h does not exist on IRIX. Anyone know another header this may be circumvented?

I may be able to build tmux 2.1. Let's try it out.
Attachments
libevent.tar
libevent.tar
(2.66 MiB) Downloaded 6 times
:O3x02L: R16000 700Mhz 8GB RAM kanna
:Octane:
:Indy: (Acclaim) R4600 133MHz 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R12000SC 300MHz 192MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.7GHz 2GB RAM kasha

User avatar
miod
Posts: 469
Joined: Fri Oct 09, 2009 2:44 am
Location: Clermont-Ferrand (France)
Contact:

Re: libevent/tmux for IRIX

Unread postby miod » Sun Jan 29, 2017 11:05 pm

Raion-Fox wrote:The problem with tmux is that err.h does not exist on IRIX. Anyone know another header this may be circumvented?

Just pick err.h and err.c, errx.c, verr.c, verrx.c, vwarn.c, vwarnx.c, warn.c, warnx.c from any *BSD libc.
:Indigo:R4000 :Indigo:R4000 :Indigo:R4000 :Indigo2:R4400 :Indigo2IMP:R4400 :Indigo2:R8000 :Indigo2IMP:R10000 :Indy:R4000PC :Indy:R4000SC :Indy:R4600 :Indy:R5000SC :O2:R5000 :O2:RM7000 :Octane:2xR10000 :Octane:R12000 :O200:2xR12000 :O200: - :O200:2x2xR10000 :Fuel:R16000 :O3x0:4xR16000 :A350:
among more than 150 machines : Apollo, Data General, Digital, HP, IBM, MIPS before SGI, Motorola, NeXT, SGI, Solbourne, Sun...

User avatar
Raion-Fox
Donor
Donor
Posts: 1129
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

Re: libevent/tmux for IRIX

Unread postby Raion-Fox » Sun Jan 29, 2017 11:18 pm

I found the way around it however now it breaks simply because IRIX is unrecognized by the build system - it has support for aix, hpux and solaris but it doesn't know what IRIX has in compat/. Grr. Looks like I'm gonna have to define that all out.

EDIT: The problem is because os-unknown.c doesn't build correctly - the build system doesn't know what fork-pty to do etc. So I'm gonna make a definition for irix in the build system.
:O3x02L: R16000 700Mhz 8GB RAM kanna
:Octane:
:Indy: (Acclaim) R4600 133MHz 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R12000SC 300MHz 192MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.7GHz 2GB RAM kasha

User avatar
Raion-Fox
Donor
Donor
Posts: 1129
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

Re: libevent/tmux for IRIX

Unread postby Raion-Fox » Mon Jan 30, 2017 8:33 pm

I grabbed NetBSD's err.h, added an ifdef in tmux.c for irix and I found somewhere online a forkpty implementation for irix. I'm gonna see if Krok will let me have access to his Octane again so I can test it further. I hope my hacks to automake/autotools hold up. PITA, it is.

---

GAH I'm foiled at the minute by patch 5329 va_list bug - if you have the patch please PM me immediately.

I have already created ifdefs to fix err.h, hacked configure.ac and patched out the forkpty.c by finding an old forkpty.c online that works okay.

---

Using a series of ill-advised removals of va_list, I was able to bypass the error but now imsg.c wants IOV_MAX and SCM_RIGHTS, neither of which I think exist on IRIX... help?
Last edited by foetz on Tue Jan 31, 2017 7:18 am, edited 1 time in total.
Reason: merged
:O3x02L: R16000 700Mhz 8GB RAM kanna
:Octane:
:Indy: (Acclaim) R4600 133MHz 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R12000SC 300MHz 192MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.7GHz 2GB RAM kasha

User avatar
miod
Posts: 469
Joined: Fri Oct 09, 2009 2:44 am
Location: Clermont-Ferrand (France)
Contact:

Re: libevent/tmux for IRIX

Unread postby miod » Tue Jan 31, 2017 3:49 am

Raion-Fox wrote:Using a series of ill-advised removals of va_list, I was able to bypass the error but now imsg.c wants IOV_MAX and SCM_RIGHTS, neither of which I think exist on IRIX... help?

Be sure to compile with _XOPEN_SOURCE defined (to get SCM_RIGHTS among other things), and use _XOPEN_IOV_MAX for IOV_MAX.
:Indigo:R4000 :Indigo:R4000 :Indigo:R4000 :Indigo2:R4400 :Indigo2IMP:R4400 :Indigo2:R8000 :Indigo2IMP:R10000 :Indy:R4000PC :Indy:R4000SC :Indy:R4600 :Indy:R5000SC :O2:R5000 :O2:RM7000 :Octane:2xR10000 :Octane:R12000 :O200:2xR12000 :O200: - :O200:2x2xR10000 :Fuel:R16000 :O3x0:4xR16000 :A350:
among more than 150 machines : Apollo, Data General, Digital, HP, IBM, MIPS before SGI, Motorola, NeXT, SGI, Solbourne, Sun...

User avatar
Raion-Fox
Donor
Donor
Posts: 1129
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

Re: libevent/tmux for IRIX

Unread postby Raion-Fox » Tue Jan 31, 2017 7:47 am

Gotcha I'll add ifdefs for that

---

Okay so I added an ifdef to imsg.c, imsg.h & imsg-buffer.c

#if defined(irix) || defined (__irix__) || defined(sgi) || defined (__sgi__)
#define _XOPEN_IOV_MAX 16
#define _XOPEN_SOURCE 4
#endif

Worked somewhat well. Now I've got issues with imsg-buffer.c

Ugh I give up for the present. I need to get FoxBSD Alpha 1 Faye Valentine released. In the meantime, I'll drop the patched code here. I removed err.h and the compiler allows implicit declaration even though that's a warning. This is NOT my best work by far, it's probably some of the worst code I've pushed. forkpty-unknown.c is not my work at all but some random old code I found online in the sourceforge repo. It's hacked together, its nasty and it's probably broken in a few places.
Attachments
tmux-master-irix.tar
(4.29 MiB) Downloaded 6 times
Last edited by foetz on Tue Jan 31, 2017 2:05 pm, edited 1 time in total.
Reason: merged
:O3x02L: R16000 700Mhz 8GB RAM kanna
:Octane:
:Indy: (Acclaim) R4600 133MHz 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R12000SC 300MHz 192MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.7GHz 2GB RAM kasha

User avatar
spiroyster
Donor
Donor
Posts: 86
Joined: Thu May 03, 2012 8:24 am
Location: Somerset, UK

Re: libevent/tmux for IRIX

Unread postby spiroyster » Wed Feb 01, 2017 3:25 am

Implicit declaration? function will be assumed to return an int, so better hope it does :)

Which compiler are you using for this? If gcc, it's recommended to compile with '-Werror' or enforce later standards. This isn't a compliers problem, more a linkers problem, hence it's a compiler warning. This is in fact old standard for a compiler to let this slip, and can lead to problematic code at run time (if linker lets it pass) which is why later standards (C99) prohibit this.

If you know the signature of the function you are calling (o.0),I can't see a reason not to prototype it?

Also, are _XOPEN_IOV_MAX and _XOPEN_SOURCE pre defined to different values? if so advisable to #undef before defining them.

User avatar
Raion-Fox
Donor
Donor
Posts: 1129
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

Re: libevent/tmux for IRIX

Unread postby Raion-Fox » Wed Feb 01, 2017 11:41 am

spiroyster wrote:Implicit declaration? function will be assumed to return an int, so better hope it does :)


I was having issues with u_char so I typdef'd it as unsig

spiroyster wrote:Which compiler are you using for this? If gcc, it's recommended to compile with '-Werror' or enforce later standards. This isn't a compliers problem, more a linkers problem, hence it's a compiler warning. This is in fact old standard for a compiler to let this slip, and can lead to problematic code at run time (if linker lets it pass) which is why later standards (C99) prohibit this.


The place where I got stuck was the struct ibuf in imsg.h being declared by the code not picking it up. I was using GCC 4.7. I was gonna run them with GCC first, and then try making them run under MIPSPro if there was performance benefits.

spiroyster wrote:Also, are _XOPEN_IOV_MAX and _XOPEN_SOURCE pre defined to different values? if so advisable to #undef before defining them.


I don't know. I googled people who added their definitions in, checked their code and used the values there.

Here's the issue - I consider myself an amateur at C, especially when it is code that I didn't write. Now for FoxBSD, most of what I've been doing is patch integration, changes to default configs and removal of buildsystem pieces from make. I have not a lot of experience with IRIX's buildsystem.

building tmux requires automake and autotools to be installed, for autogen.sh, gmake, GCC 4.7 and the usual nekoware flags to be thrown. I'm done for the time being with this project. I have ordered a Challenge S on eBay as well as an O300, both of which will be patched and setup better for development on IRIX.
:O3x02L: R16000 700Mhz 8GB RAM kanna
:Octane:
:Indy: (Acclaim) R4600 133MHz 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R12000SC 300MHz 192MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.7GHz 2GB RAM kasha


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 1 guest