linux ¹²Ïí¿â»ù±¾Ê¹ÓÃ
1 ´´½¨ºÍʹÓþ²Ì¬¿â
´´½¨Ò»¸ö¾²Ì¬¿âÊÇÏ൱¼òµ¥µÄ¡£Í¨³£Ê¹Óà ar ³ÌÐò°ÑһЩĿ±êÎļþ£¨.o£©×éºÏÔÚÒ»Æð£¬
³ÉΪһ¸öµ¥¶ÀµÄ¿â£¬È»ºóÔËÐÐ ranlib£¬ÒÔ¸ø¿â¼ÓÈëһЩË÷ÒýÐÅÏ¢¡£
2 ´´½¨ºÍʹÓù²Ïí¿â
ÌØÊâµÄ±àÒëºÍÁ¬½ÓÑ¡Ïî
-D_REENTRANT ʹµÃÔ¤´¦ÀíÆ÷·ûºÅ _REENTRANT ±»¶¨Ò壬Õâ¸ö·ûºÅ¼¤»îһЩºêÌØÐÔ¡£
-fPIC Ñ¡Ïî²úÉúλÖöÀÁ¢µÄ´úÂë¡£ÓÉÓÚ¿âÊÇÔÚÔËÐеÄʱºò±»µ÷È룬Òò´ËÕâ¸ö
Ñ¡ÏîÊDZØÐèµÄ£¬ÒòΪÔÚ±àÒëµÄʱºò£¬×°ÈëÄÚ´æµÄµØÖ·»¹²»ÖªµÀ¡£Èç¹û
²»Ê¹ÓÃÕâ¸öÑ¡Ï¿âÎļþ¿ÉÄܲ»»áÕýÈ·ÔËÐС£
-shared Ñ¡Ïî¸æËß±àÒëÆ÷²úÉú¹²Ïí¿â´úÂë¡£
-Wl,-soname -Wl ¸æËß±àÒëÆ÷½«ºóÃæµÄ²ÎÊý´«µÝµ½Á¬½ÓÆ÷¡£¶ø -soname Ö¸¶¨ÁË
¹²Ïí¿âµÄ soname¡£
££ ¿ÉÒÔ°Ñ¿âÎļþ¿½±´µ½ /etc/ld.so.conf ÖÐÁоٳöµÄÈκÎĿ¼ÖУ¬²¢ÒÔ
root Éí·ÝÔËÐÐ ldconfig£»»òÕß
££ ÔËÐÐ export LD_LIBRARY_PATH='pwd'£¬Ëü°Ñµ±Ç°Â·¾¶¼Óµ½¿âËÑË÷·¾¶ÖÐÈ¥¡£
1.7.9 ʹÓø߼¶¹²Ïí¿âÌØÐÔ
1. ldd ¹¤¾ß
ldd ÓÃÀ´ÏÔʾִÐÐÎļþÐèÒªÄÄЩ¹²Ïí¿â, ¹²Ïí¿â×°ÔعÜÀíÆ÷ÔÚÄÄÀïÕÒµ½ÁËÐèÒªµÄ¹²Ïí¿â.
2. soname
¹²Ïí¿âµÄÒ»¸ö·Ç³£ÖØÒªµÄ£¬Ò²ÊǷdz£ÄѵĸÅÄîÊÇ soname——¼òд¹²ÏíÄ¿±êÃû£¨short for shared object name£©¡£ÕâÊÇÒ»¸öΪ¹²Ïí¿â£¨.so£©Îļþ¶øÄÚǶÔÚ¿ØÖÆÊý¾ÝÖеÄÃû×Ö¡£ÈçÇ°ÃæÌáµ½µÄ£¬Ã¿Ò»¸ö³ÌÐò¶¼ÓÐÒ»¸öÐèҪʹÓõĿâµÄÇåµ¥¡£Õâ¸öÇåµ¥µÄÄÚÈÝÊÇһϵÁпâµÄ soname£¬Èçͬ ldd ÏÔʾµÄÄÇÑù£¬¹²Ïí¿â×°ÔØÆ÷±ØÐëÕÒµ½Õâ¸öÇåµ¥¡£
soname µÄ¹Ø¼ü¹¦ÄÜÊÇËüÌṩÁ˼æÈÝÐԵıê×¼¡£µ±ÒªÉý¼¶ÏµÍ³ÖеÄÒ»¸ö¿âʱ£¬²¢ÇÒпâµÄ soname ºÍÀϵĿâµÄ soname Ò»Ñù£¬ÓþɿâÁ¬½ÓÉú³ÉµÄ³ÌÐò£¬Ê¹ÓÃеĿâÒÀÈ»ÄÜÕý³£ÔËÐС£Õâ¸öÌØÐÔʹµÃÔÚ Linux Ï£¬Éý¼¶Ê¹Óù²Ïí¿âµÄ³ÌÐòºÍ¶¨Î»´íÎó±äµÃÊ®·ÖÈÝÒס£
ÔÚ Linux ÖУ¬Ó¦ÓóÌÐòͨ¹ýʹÓà soname£¬À´Ö¸¶¨ËùÏ£Íû¿âµÄ°æ±¾¡£¿â×÷ÕßÒ²¿É
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
×î½ü×ölinuxϵͳ²Ã¼ô£¬ÐÞ¸ÄǶÈëʽϵͳµÄinittabÎļþʱÎ󽫱¾»úinittabÎļþÐ޸ġ£
rebootºó³öÏÖ
INIT: /etc/inittab[2]: missing id field
INIT: /etc/inittab[3]: missing id field.
Enterrunlevel:
ÊäÈë3,»ò1£¬»òsinggleºó³öÏÖ
INIT: no more processess left in this runlevel
ϵͳֹͣ¡£
google£¬baiduµ½Ò»ÆªÒý ......
¹«Ë¾ÓиöÓÃARM940T×öµÄÊÖ³Öʽ²úÆ·£¬ÎÒÃÇÒÆÖ²ÁËÒ»¸öuClinuxÉÏÈ¥£¬ÏµÍ³»¹ÊÇÔËÐв»´íµÄ¡£
ÒòΪûÓдøÍø¿Ú£¬Ö»ÓÐUSBת´®¿Ú¿ÉÒÔʹÓã¬ËùÒÔÏëÑ°ÕÒÒ»¸öÎȶ¨µÄ´«Êä;¾¶£¬ÔÚhostºÍdeviceÖ®¼ä½»»»Îļþ¡£ÎÊÁ˺ܶàÈ˶¼²»Çå³þ£¬»¹ÊÇÒª¿¿×Ô¼ºÕÒ½â¾ö·½·¨¡£
ÔÚgoogleÉÏÕÒÁË°ëÌ죬ÖÕÓÚÕÒµ½ÁËÒ»¸ö¿ÉÒÔͨ¹ý´®¿Ú´«ËÍÎļþµÄÈí¼þ£¬Õâ¾ÍÊǹŶ¼ ......
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <s ......
1¡¢Ïà¹ØÃüÁ
ulimit –a //²é¿´µ±Ç°ÉèÖÃ
ulimit –n 2048 //¼´Éè³É2048£¬°´Êµ¼ÊÐèÒªÉèÖÃ
2¡¢Óû§»·¾³²ÎÊýÎļþÅäÖãº
ÔÚ/etc/profileÖмÓÈëÈçÏÂÄÚÈÝ£º
if
[ $SHELL
=
"
/bin/ksh
"
]; then
ulimit
-
p
16384
ulimit&nbs ......