ºìÁªLinuxÃÅ»§
Linux°ïÖú

Solaris´î½¨64λCÓïÑÔ¿ª·¢»·¾³

·¢²¼Ê±¼ä:2014-06-10 09:40:57À´Ô´:ºìÁª×÷Õß:velcbo
¸ÕÀ´¹«Ë¾Ê±£¬¹«Ë¾µÄC³ÌÐò»¹ÊÇ32λµÄ¡£ºóÀ´ÎÒÔĶÁÁËһЩ×ÊÁÏ£¬¾õµÃ64λµÄ³ÌÐò²ÅÊÇÕæÕýµÄÇ÷ÊÆ£¬ËùÒԾͿªÊ¼³¢ÊÔ×Å¿ª·¢64λµÄ³ÌÐò¡£ÕâÆªÎÄÕ½éÉÜÈçºÎÔÚSolarisÏ´64λCÓïÑÔ¿ª·¢»·¾³£¬Ï£Íû¸øÐèÒªµÄÅóÓÑÒ»µã°ïÖú¡£

£¨1£©gcc

SolarisµÄ/usr/sfw/bin/gcc¿ÉÒÔÓÃÀ´±àÒë64λC³ÌÐò£¬µ«ÊÇÐèÒª¼Ó-m64±àÒëÑ¡Ïî¡£´ËÍâÒ²¿ÉÒÔ´ÓgccµÄ¹ÙÍøÏÂÔØgccÔ´´úÂ룬×ÔÐбàÒë°²×°£¬µ«ÊÇҪעÒâ±àÒë³öÀ´µÄgccÐèÒªÊÇ64λµÄ¡£

£¨2£©gdb

µ÷ÊÔ64λC³ÌÐòÐèÒª64λµÄgdb£¬gdbµÄ°²×°²½ÖèÈçÏ£¨ÒÔ7.6°æ±¾ÎªÀý£©£º

1£©gunzip gdb-7.6.tar.gz
2£©tar xvf gdb-7.6.tar
3£©cd gdb-7.6
4£©export CC="/usr/sfw/bin/gcc -m64"
5£©./configure -prefix=¡°/¡­/¡­(a folder path)¡±
6£©make
7£©make install

ÐèҪעÒâµÄÊÇ£¬Ä¿Ç°gdbµÄ×îа汾ÊÇ7.7£¬ÔÚSolarisϱàÒë»áÓдíÎó¡£

£¨3£©²Î¿¼×ÊÁÏ

¸öÈËÈÏΪOracleµÄÕâ±¾¡¶Solaris 64-bit Developer¡¯s Guide¡·£¬ÊÇÔÚSolarisÏ¿ª·¢64λC³ÌÐò×îºÃµÄ×ÊÁÏ¡£Ã¿Ò»Î»CÓïÑÔ¿ª·¢Õß¶¼Ó¦¸Ã¿´Ò»Ï£¬ÏàÐŶ¼ÄÜÊÜÒæ·Ëdz¡£[code]bfd/cache.c doesn't compile with gcc -m64 on Solaris

On current mainline, bfd/cache.c doesn't compile with gcc -m64 on
Solaris 8 to 11:

cc1: warnings being treated as errors
/vol/src/gnu/gdb/gdb-7.7/bfd/cache.c: In function 'bfd_cache_max_open':
/vol/src/gnu/gdb/gdb-7.7/bfd/cache.c:85: error: comparison between signed and unsigned integer expressions

This breaks both binutils 2.24 and gdb 7.7 builds and is a regression
from the previous releases.

The error is about

&& rlim.rlim_cur != RLIM_INFINITY)

where has

typedef unsigned long rlim_t;
#define RLIM_INFINITY (-3l)

While I've raised the issue with Oracle, this won't help for shipping
Solaris releases. The problem can easily be avoided by casting
RLIM_INFINITY to rlim_t, as the following patch does.

Ok for mainline and the binutils 2.24 branch?

Rainer

2014-02-06 Rainer Orth CeBiTec.Uni-Bielefeld.DE>

* cache.c (bfd_cache_max_open): Cast RLIM_INFINITY to rlim_t.

--- bfd/cache.c 2013/12/08 04:55:47 1.1
+++ bfd/cache.c 2014/02/06 16:13:27
-82,7 +82,7 bfd_cache_max_open (void)
#ifdef HAVE_GETRLIMIT
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
- && rlim.rlim_cur != RLIM_INFINITY)
+ && rlim.rlim_cur != (rlim_t) RLIM_INFINITY)
max = rlim.rlim_cur / 8;
else
#endif /* HAVE_GETRLIMIT */

--

--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University[/code]×÷Õߣºyigeshouyiren
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ