[Œ®Õò¢Ì] NeXTSTEP Porting Tips
òµ·ºƒÃ: capri91 [òÈÚò©Õ] 2007-04-19 23:46:45
General Porting Tips

While porting many UNIX-progs to NeXTstep, I stumbled over some nasty but solveable problems:

cc: Internal compiler error: program cc1obj got fatal signal 11
I found three memory related solutions so far:
-> turn off Optimization (-Ox) ...or...
-> turn off Debug (-g) ...or...
-> limit stacksize 10000 (before make)

foo.h:247: macro `index' used with just one arg
#undef index (index is already defined in string.h!)

foo.c:1234: bad macro argument list
-> add --traditional-cpp to CFLAGS

ld: Undefined symbols: _strdup
-> gcc -o foo bar.o -lstdc++ ...or...
-> gcc -o foo bar.o -liberty

ld: Undefined symbols: _mkfifo
-> mknod(path, S_IFIFO|mode, 0);

undefined type, found `pid_t'
typedef int pid_t;

POSIX (not recommend):
-> gcc -posix ... -lposix


Functions and their Replacements

getcwd can be replaced by the BSD-command getwd(pathname). The pathnames length must not be longer then MAXPATHLEN characters (1024), as defined in <sys/param.h>.

waitpid can be implemented as a macro, using one of the BSD waitN functions, e.g.,
#define waitpid(p, s, o)  wait3((union wait *)(s), (o), (struct rusage *) 0)

NeXTstep 3.3 does not have uname.

Functions
[ basename.c | getcwd.c | getschr.c | mmap.c | putenv.c | setenv.c | sp_offset.c | strdup.c | tcgetattr.c | tempnam.c | tempname.c | termios.c ]

POSIX-binaries
On a black NeXT you can use otool, to get some working functions out of libposix.a, e.g.
[ sigaction.o | sigsetops.o ]

ò¶Þò†Ú: http://www.drolls.de/NeXT/Porting.html, http://www.math.unl.edu/~rdieter/OpenStep/Developer/PortingTips/
òµ·ºƒÃ: onion[òÁ›ò©Þ] [òÈÚò©Õ] 2007-04-23 11:36:48
óµÑ...òÚÀòÖ·......T.T
òµ·ºƒÃ: capri91[òÁ›ò©Þ] [òÈÚò©Õ] 2007-04-23 12:54:17
Œ®Ñò×ÐŒ‚® òÕ‰óÕÞ ò†Û óÕÚòËÞŒ‚®ºÊÔ... ^^;
òµ·ºƒÃ: onion[òÁ›ò©Þ] [òÈÚò©Õ] 2007-04-24 07:16:24
òÕ‰óÕÚºË⁄Œ¦‹òÜÔ..-.-;
ºÓ–º¡µóÌÌòµ… òÙÅòµÌ

  òµ· ºƒÃ  òÕÔ óÚ‚  º‡·òÕÈò‰ÔºÓÞ  
º†ÈóÚ‚ò×ÑòÖò×кÁ©ò§Þò¡®óÜÌò©Þ    º“’
690LineRoh2007-05-012020   ó΂ò§Ñ òÕ¤º†Ôòµ·º×  º‹·òÙÇòµ‚Œ®  (7)
689onion2007-04-271071   Œ®ÐòÁ‹óÕ’ºËȺË⁄..~.~ (2)
688LineRoh2007-04-221231   NEXTSTEP óÑÞŒ‚®º†Õ, Œ®ÃºË¤ó×È òÁ·òµÃ º¶Ûòµ·ò×к’·... (7)
687capri912007-04-191790   [Œ®Õò¢Ì] NeXTSTEP Porting Tips (3)
686capri912007-04-192844   [Œ®Õò¢Ì] License Strings for NeXTSTEP Applications (2)
685onion2007-03-171236   òÖóÕÞòÁ‹º§È.. º¶ óÂÀòµ· ò×ÈòʦºËȺË⁄... (15)
684LineRoh2007-03-101110   º†ÈŒ®Þ óÝÃŒ‚® (2)
683LineRoh2007-03-071416   [òÕ̺ƒ…] º†ÈŒ®Þ Œ‡¦ò§  (7)
682òÃÞò§ óÛÚ2007-03-07996   òÞÃòÕȺ¶  Œ· º©¤ òµ…º‡‚ òÁ‹Œ‡…òÙÐ ºÌ óÕÞ CNN óÈ‹óÑÞòÙÐòÃÞ
681Œ„ ºÑÐóÚ‚2007-03-071212   ºÃ¥òÊ⁄óÊ‚óÀк‚Ì óÕÚºÓÞŒ¦Ðò†· º®Ï OS º„̺ÓÞ º‹‚òµÚ (2)
680ºË⁄º“¤óÅ©ºƒ‹2007-03-071366   [ºÓÞºƒ‰ºËȺË⁄]ibm ºÃ•óÔ…ºËÈóË® kb-7953 º‚Ôº×Û+òÕú¡© A106 Œ‚®Œ‡Ãò˵ º‚Ôº×Û (13)
679òÃÞò§ óÛÚ2007-03-061156   NextStation Color Turbo óÌк§⁄ (3)
678ºÏÛòÖ...2007-03-051340   NeXTSTEP òͤ º‡·º©⁄º’·.. (3)
677Œ„ ò§ÃòÈÚ2007-03-041121   [ºÓÞºƒ‰ºËȺË⁄] ò§ÑòÙÐ ò×ȺÊÔ òÅÌòÅÌóÕÞ Œ†ÂºÓ⁄ ò©Õºƒ‹ (8)
676Œ„ ò§ÃòÈÚ2007-03-041077   òÖóÕÞòÁ‹º§È, ò§ÑòÙÐ òÃÞ òÖ·ºÖ⁄ ò×¥º„ÃòÓ®òËÞºÁÚòÜÔ ? (7)
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] íÖ¶
[º“’º¡µº‡·Œ‚®] [Œ‚ òÓ®Œ‚®]