python / cpython

The Python programming language
https://www.python.org
Other
63.5k stars 30.42k forks source link

SunOS 4.1.4 with GCC 2.95.2 can't compile complete #33166

Closed da8b655d-9f08-4fbe-a9c2-0163e87a512e closed 24 years ago

da8b655d-9f08-4fbe-a9c2-0163e87a512e commented 24 years ago
BPO 215035
Nosy @gvanrossum, @loewis

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = 'https://github.com/gvanrossum' closed_at = created_at = labels = ['build'] title = "SunOS 4.1.4 with GCC 2.95.2 can't compile complete" updated_at = user = 'https://bugs.python.org/moroo' ``` bugs.python.org fields: ```python activity = actor = 'moroo' assignee = 'gvanrossum' closed = True closed_date = None closer = None components = ['Build'] creation = creator = 'moroo' dependencies = [] files = [] hgrepos = [] issue_num = 215035 keywords = [] message_count = 6.0 messages = ['1511', '1512', '1513', '1514', '1515', '1516'] nosy_count = 3.0 nosy_names = ['gvanrossum', 'loewis', 'moroo'] pr_nums = [] priority = 'low' resolution = 'fixed' stage = None status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue215035' versions = [] ```

da8b655d-9f08-4fbe-a9c2-0163e87a512e commented 24 years ago

1) Module/posixmodule.c In Module/posixmodule.c, it used rename, pclose, fclose but SunOS 4.1.4's unistd.h does not have these definitions. So add them. 2) Modules/mmapmodule.c In Modules/mmapmodule.c, MS_SYNC used but SunOS 4.1.4's mman.h does not have this difinition. So add it.

gvanrossum commented 24 years ago

I'm not sure what the proper solution is here. Can you provide a patch? Which C preprocessor symbol do I check for to know that I'm on SunOS 4.1.4?

(1) We can't add decls for these funcs unconditionally because it would conflict with decls in unistd.h or elsewhere on other platforms.

(2) What is the proper replacement for MS_SYNC on SunOS 4.1.4?

61337411-43fc-4a9c-b8d5-4060aede66d0 commented 24 years ago

Specifying MS_SYNC is not necessary on SunOS 4, the msync manpage says

MS_ASYNC returns msync() immediately once all I/O operations are scheduled; normally, msync() will not return until all I/O operations are complete.

So it is safe to define it as 0.

I believe SunOS 4 can be recognized by testing that "sun" is defined and "__SVR4" is not.

According to the man pages, the missing prototypes are

       int rename(path1, path2)
       char *path1, *path2;
       fclose(stream)
       FILE *stream;
       pclose(stream)
       FILE *stream;

Indeed, no header file on this system has an fclose prototype...

da8b655d-9f08-4fbe-a9c2-0163e87a512e commented 24 years ago

Pathes are last half of this message.

And more trouble 1) When making -L does not have any arguments, so making is stopped. 2) Some test does not pass. test log added next of pacthes.

Patches: --- Patch Begin --- *** Modules/mmapmodule.c.org Fri Sep 22 17:01:14 2000 --- Modules/mmapmodule.c Fri Sep 22 16:52:55 2000


* 24,29 ** --- 24,35 ----

  #define UNIX
  #endif

+ #ifdef sun
+ #ifndef MS_SYNC
+ #define MS_SYNC 0x0
+ #endif
+ #endif
+
  #ifdef MS_WIN32
  #include <windows.h>
  #endif
*** Modules/posixmodule.c.org   Fri Sep 22 17:01:25 2000
--- Modules/posixmodule.c       Fri Sep 22 16:51:46 2000
***************
*** 106,111 ****
--- 106,118 ----

  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
+ #ifdef sun
+ #ifdef _POSIX_VERSION
+ extern int rename(const char *, const char *);
+ extern int pclose(FILE *);
+ extern int fclose(FILE *);
+ #endif
+ #endif
  #endif

  #ifdef NeXT

--- Patch End ---

--- Test Log ---

Delete successed lines.

test test_cgi crashed -- exceptions.AttributeError: uname test test_format crashed -- exceptions.SystemError: error return without excepti on set test test_largefile skipped -- platform does not have largefile support test test_poll skipped -- select.poll not defined -- skipping test_poll test test_popen2 crashed -- exceptions.AttributeError: waitpid test test_pwd crashed -- exceptions.AttributeError: getpwall test test_signal crashed -- exceptions.AttributeError: alarm test test_socket crashed -- exceptions.AttributeError: getpeername test test_strftime skipped -- cannot import name mktime test test_time crashed -- exceptions.AttributeError: clock test test_unicode crashed -- exceptions.SystemError: error return without except ion set test test_urllib crashed -- exceptions.AttributeError: quote 9 tests failed: test_cgi test_format test_popen2 test_pwd test_signal test_socke t test_time test_unicode test_urllib 31 tests skipped: test_al test_audioop test_bsddb test_cd test_cl test_crypt tes t_dbm test_dl test_fork1 test_gc test_gdbm test_gl test_gzip test_imageop test_i mgfile test_largefile test_linuxaudiodev test_minidom test_nis test_openpty test _poll test_pty test_pyexpat test_rgbimg test_strftime test_sunaudiodev test_thre ad test_timing test_winreg test_winsound test_zlib test test_cgi crashed -- exceptions.AttributeError: uname test test_format crashed -- exceptions.SystemError: error return without excepti on set test test_largefile skipped -- platform does not have largefile support test test_longexp crashed -- exceptions.MemoryError: test test_popen2 crashed -- exceptions.OSError: [Errno 12] Not enough memory test test_pwd crashed -- exceptions.AttributeError: getpwall /bin/sh: 12372 Memory fault - core dumped --- End ---

gvanrossum commented 24 years ago

Fixed both issues. Please test from the CVS tree (or wait for 2.0b2, in two days), as I don't have a SunOS 4.1.4 system available for testing!

da8b655d-9f08-4fbe-a9c2-0163e87a512e commented 24 years ago

I tried to build Python 2.0b2 on SunOS 4.1.4. It looks good on posixmodule and mmapmodule. But now unicodedatabase causes error. SunOS 4.1.4 does not have NULL. So add NULL define on unicodedatabase.c.

And one more build error (I reported already on 2000-Sep-24 23:54) gcc -L python.o \ ../libpython2.0.a -lnsl -ldl -lm -o python ld: -L: pathname missing collect2: ld returned 4 exit status

Test status: 63 tests OK. 8 tests failed: test_format test_popen2 test_pwd test_signal test_socket test_ti me test_unicode test_unicodedata 31 tests skipped: test_al test_audioop test_bsddb test_cd test_cl test_crypt tes t_dbm test_dl test_fork1 test_gdbm test_gl test_gzip test_imageop test_imgfile t est_largefile test_linuxaudiodev test_minidom test_nis test_openpty test_poll te st_pty test_pyexpat test_rgbimg test_sax test_strftime test_sunaudiodev test_thr ead test_timing test_winreg test_winsound test_zlib

test test_format crashed -- exceptions.SystemError: error return without exception set test test_popen2 crashed -- exceptions.OSError: [Errno 12] Not enough memory test test_pwd crashed -- exceptions.AttributeError: getpwall test test_signal crashed -- exceptions.AttributeError: alarm test test_socket crashed -- exceptions.OSError: [Errno 12] Not enough memory test test_time crashed -- exceptions.AttributeError: clock test test_unicode crashed -- exceptions.SystemError: error return without exception set