Opened 8 years ago

Closed 2 years ago

#52070 closed defect (fixed)

tmux @ 2.2 compile failed in tiger ppc

Reported by: rickyzhang82 (Ricky Zhang) Owned by: tessus (Helmut K. C. Tessarek)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: tiger powerpc Cc:
Port: tmux

Description

I haven't figured it out what went wrong. See attached log.

Attachments (1)

main.log (52.8 KB) - added by rickyzhang82 (Ricky Zhang) 8 years ago.
build log

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by rickyzhang82 (Ricky Zhang)

Attachment: main.log added

build log

comment:1 Changed 8 years ago by kenneth.f.cunningham@…

The first error is this:

413	:info:build compat/imsg.h:32: error: expected specifier-qualifier-list before 'u_char'

Googling "macosx tiger error: expected specifier-qualifier-list before 'u_char'" we find a few references to this kind of error. <http://stackoverflow.com/questions/5087257/error-after-compilation-in-c> and <https://ghc.haskell.org/trac/ghc/ticket/5135#no1> seem possibly related to this issue in this case.

In particular, it seems likely that the failed inclusion of the definition of u_char will be related to this file ""/usr/include/sys/types.h"" not being included or the appropriate block being parsed.

To start, I'd try adding

#include <sys/types.h>

near the top in compat.h, and see what happens. compat.h sounds like the kind of file where this should go, and seems to be included in most of the other files in the project.

Also, there are some changes in "/usr/include/sys/types.h" depending on the system you're using, and so there might need to be some manipulation of the guard block to get it to compile on Tiger.

On later systems, we see something like this in <sys/types.h>

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
typedef	unsigned char		u_char;
typedef	unsigned short		u_short;
typedef	unsigned int		u_int;
#ifndef _U_LONG
typedef	unsigned long		u_long;
#define _U_LONG
#endif
typedef	unsigned short		ushort;		/* Sys V compatibility */
typedef	unsigned int		uint;		/* Sys V compatibility */
#endif

whereas on Tiger, the block looks like this:

#ifndef _POSIX_C_SOURCE
typedef unsigned char       u_char;
typedef unsigned short      u_short;
typedef unsigned int        u_int;

I hope this gets you started. I am away from my Tiger machines just now, so can't test it for you directly. -- K

Last edited 8 years ago by kenneth.f.cunningham@… (previous) (diff)

comment:2 Changed 8 years ago by rickyzhang82 (Ricky Zhang)

Thanks for your prompt response.

I downgrade to rev 123176 to mitigate the issues. My iBook overheat for overnight compiling other macports dependency. I need tmux badly so that I can ssh, turn off the screen and move it to the cooler place. TBH, iBook just burn my left palm due to the heat.

I will get you back and give a try once I finish my project. Again, thank you!

comment:3 Changed 8 years ago by kenneth.f.cunningham@…

Great. Hope this works. A great number of the current ports will build all the way back to Tiger without too much trouble, but minor tweaks are often needed -- Best, K

Last edited 8 years ago by kenneth.f.cunningham@… (previous) (diff)

comment:4 Changed 8 years ago by mf2k (Frank Schima)

Keywords: powerpc added
Owner: changed from macports-tickets@… to tessarek@…

In the future, please Cc the port maintainers (port info --maintainers tmux), if any.

comment:5 Changed 8 years ago by tessus (Helmut K. C. Tessarek)

Several things to take into consideration:

  • tmux already had some issues compiling on 10.4 2 years ago
  • these things should be changed upstream -> open a ticket with tmux developers
  • the tmux devs don't care about ancient OS versions
  • the change I did to fix the problem with 10.4 was a workaround, not a solution
  • if you want me to change tmux code to work on 10.4, I need access to a 10.4 machine (the person who reported the last 10.4 issue gave me remote access)
  • changes to tmux that involve old OS versions might not even work, because tmux uses features not available on older OS versions

Please note that I'm not unwilling to make changes, but I am unsure about the feasibility. At one point, people have to understand that newer software might not run on systems that are 11 years old. Especially, if the processor type is not even used anymore and Apple deprecates API from OS versions not even 4 years old.

comment:6 Changed 8 years ago by kenneth.f.cunningham@…

including <sys/types.h> did not immediately work, so rather than play with the guards, I just put the following near the top in compat.h

typedef	unsigned char		u_char;
typedef	unsigned short		u_short;
typedef	unsigned int		u_int;

and that did alleviate all the missing types errors. However, that's not the end of the story. There are more errors that crop up after that with other missing functions (timer functions, flock function, strcasecmp, strlcpy). I suspect some of these functions either got shuffled around in the #include files, or are being blocked by guards...

I have a bank of 5 machines currently running Tiger, so perhaps I can make one of them available to tessarek to have a look for you (who already knows the code well) and has been down this road before. -- Ken

comment:7 Changed 8 years ago by rickyzhang82 (Ricky Zhang)

When I compiling libassuan-2.4.3 during git install, I also found the same problem https://trac.macports.org/ticket/51708#comment:3.

I'm curious how configure set _DARWIN_C_SOURCE and _POSIX_C_SOURCE in both tiger and 10.11

comment:8 Changed 2 years ago by evanmiller (Evan Miller)

In 2a6500378e00f10c750193ec5a7e7c0bc8b5713e/macports-legacy-support (master):

Define u_char etc on Tiger using Leopard rules

A number of ports run into trouble compiling on Tiger because
_XOPEN_SOURCE results in _POSIX_C_SOURCE being defined, thus hiding the
u_char, u_int, and other typedefs. Leopard and later provide a
workaround in the form of _DARWIN_C_SOURCE; follow this behavior.

See: #52070
See: #62997

comment:9 Changed 2 years ago by evanmiller (Evan Miller)

Resolution: fixed
Status: newclosed

In 967c7532f68193ba7c4415caeab0ca2b65647643/macports-ports (master):

tmux: fix build on Tiger

Closes: #52070

Note: See TracTickets for help on using tickets.