Glibc 2 ÇÏ¿ìÅõ Eric Green, thrytis@imaxx.net v1.2, 26 October 1997 Glibc 2 ÇÏ¿ìÅõ´Â ¸®´ª½º ½Ã½ºÅÛ¿¡¼­ GNU C Library version 2(libc 6)¸¦ ¼³Ä¡ÇÏ°í »ç¿ëÇÏ´Â ¹æ¹ýÀ» ´Ù·é´Ù. ______________________________________________________________________ Table of Contents: 1. ¼Ò°³(Introduction) 1.1. glibc 2¶õ? 1.2. ÀÌ ¹®¼­¿¡ ´ëÇؼ­ 1.3. ÀÌ ¹®¼­¿¡¼­ ÃÖ±Ù º¯°æµÈ ³»¿ë 2. ¼³Ä¡ÇÏ´Â ¹æ¹ýÀ» ¼±ÅÃÇÏÀÚ. 3. library¸¦ ¾ò±â 4. ½ÃÇè»ï¾Æ ¼³Ä¡Çϱâ 4.1. ÄÄÆÄÀÏÇϱâ¿Í ¼³Ä¡Çϱâ 4.1.1. ÀüÁ¦ Á¶°Ç 4.1.2. ¼Ò½º¸¦ ÃßÃâÇϱâ 4.1.3. Configure¸¦ ½ÇÇàÇϱâ 4.1.4. ÄÄÆÄÀÏÇϱâ¿Í ¼³Ä¡Çϱâ 4.2. µ¿Àû·Î´õ(dynamic loader)¸¦ ¾÷±×·¹À̵åÇÏÀÚ. 4.3. gcc¸¦ configureÇϱâ 4.4. Çì´õ ÆÄÀÏ ¸µÅ©¸¦ ¾÷µ¥ÀÌÆ®Çϱâ. 4.5. ¼³Ä¡µÈ°ÍÀ» Å×½ºÆ®Çϱâ 5. Primary C library·Î ¼³Ä¡Çϱâ 5.1. ¼Ò½º·ÎºÎÅÍ ¶óÀ̺귯¸®¸¦ ¼³Ä¡Çϱâ 5.1.1. ÀüÁ¦ Á¶°Ç 5.1.2. ¼Ò½º¸¦ ÃßÃâÇϱâ 5.1.3. Configure¸¦ ½ÇÇàÇϱâ 5.1.4. ÄÄÆÄÀÏÇϱâ 5.2. ¼³Ä¡Çϱâ À§ÇÑ Áغñ ÀÛ¾÷Çϱâ 5.3. ¹ÙÀ̳ʸ® ÆÐÅ°Áö·ÎºÎÅÍ ¼³Ä¡Çϱâ 5.4. ¼Ò½º·ÎºÎÅÍ ¼³Ä¡Çϱâ 5.5. gcc specs À» ¾÷µ¥ÀÌÆ®Çϱâ 5.6. ¼³Ä¡µÈ°ÍÀ» Å×½ºÆ®Çϱâ 6. non-primary libc·Î ÄÄÆÄÀÏÇϱâ 6.1. non-primary libcs »ç¿ëÇÒ ¶§ °æ°í 6.2. ¿¬½À¿ë glibc¿Í ÇÔ²² ÄÄÆÄÀÏÇϱâ. 6.3. Compiling programs with libc 5 when glibc is primary library 7. C++ ÇÁ·Î±×·¥À» ÄÄÆÄÀÏÇϱâ 7.1. ¿¬½À¿ë glibc ¼³Ä¡ÀÇ °æ¿ì¿¡ ´ëÇÑ libg++¼³Ä¡Çϱâ 7.2. ÁÖ glibc ¼³Ä¡ÀÇ °æ¿ì¿¡ ´ëÇÑ libg++ ¼³Ä¡Çϱâ 7.3. non-primary libc·Î C++ÇÁ·Î±×·¥ ÄÄÆÄÀÏÇϱâ 8. ¹ö±× º¸°íÇϱâ 9. »ùÇà specs ÆÄÀÏ 10. Miscellanea 10.1. Further information 10.1.1. Web Pages 10.1.2. Newgroups 10.2. Credits 10.3. Feedback ______________________________________________________________________ 1. ¼Ò°³(Introduction) 1.1. glibc 2¶õ? Glibc 2Àº GNU C LibraryÀÇ ÃֽŠ¹öÀüÀ̸ç, ÇöÀç GNU Hurd ½Ã½ºÅÛ, ¸®´ª½º i386, m68k, and alpha ½Ã½ºÅÛ¿¡¼­ ½ÇÇàµÈ´Ù. ±×¸®°í ¸®´ª½º PowerPC, MIPS, Sparc·Î Æ÷ÆÃÀÛ¾÷Àº ÇöÀç °³¹ß ÁßÀÌ´Ù. ¾ÕÀ¸·Î °èȹÀº ´Ù¸¥ architectures¿Í ¿î¿µÃ¼°è¿¡ ´ëÇÑ Áö¿ø¿©ºÎ¸¦ ÷°¡ÇÏ´Â °ÍÀÌ´Ù.^^ ¸®´ª½º¿¡¼­´Â glibc 2°¡ Linux libc 5ÀÇ ´ÙÀ½ ¹öÀüÀÎ libc major version 6 À¸·Î »ç¿ëµÇ°í ÀÖ´Ù. ÀÌ·¯ÇÑ °úÁ¤Àº Linux libc °³¹ßÀÚµéÀÇ ÀǵµÀ̱⵵ Çß´Ù. ÇöÀç´Â ½ÇÇèÀûÀÌÁö¸¸ glibc 2¿¡ °ü½ÉÀÖ´Â »ç¶÷µéÀÌ Æò°¡ÇÏ°í »ç¿ëÇϴµ¥¿¡´Â ÃæºÐÈ÷ ¾ÈÁ¤¼ºÀÌ ÀÖ´Ù. ¸¸¾à ´ç½ÅÀÌ »ç¿ëÇÏ´Â ÇÁ·Î±×·¥ÀÌ glibc 2¸¦ Áö¿øÇÑ´Ù¸é ÃֽŠ¹öÀüÀº »ó´çÈ÷ ¾ÈÁ¤ÇÏ´Ù. ¹öÀü 2.1Àº main stream use¿¡ ´ëÇÑ ¹öÀüÀÌ µÉ °ÍÀÌ´Ù. glibc 2¿¡¼­ À¯¿ëÇÏ´Â 3°¡Áö Ãß°¡ ¿É¼Ç(optional add-ons)ÀÌ ÀÖ´Ù. Crypt UFC-crypt ÆÐÅ°ÁöÀÌ´Ù. Export restriction¶§¹®¿¡ ºÐ¸®½ÃÄ×´Ù. LinuxThreads An implementation of the Posix 1003.1c "pthread" interface. Locale data Contains the data needed to build the locale data files to use the internationalization features of the glibc. 1.2. ÀÌ ¹®¼­¿¡ ´ëÇؼ­ ÀÌ ÇÏ¿ìÅõ ¹®¼­´Â Á¸ÀçÇÏ´Â ¸®´ª½º ½Ã½ºÅÛ¿¡¼­ glibc 2 library¸¦ ¼³Ä¡ÇÏ´Â °ÍÀ» ´Ù·ê·Á°í ÇÑ´Ù. ÇöÀç libc 5¸¦ »ç¿ëÇÏ´Â Intel ±â¹ÝÀÇ ½Ã½ºÅÛÀÇ »ç¿ëÀÚ¸¦ À§Çؼ­ Àû¾ú´Ù. ±×·¯³ª ´Ù¸¥ ½Ã½ºÅÛÀ» »ç¿ëÇÏ´Â »ç¶÷À̳ª glibc 1°ú °°Àº º¯°æµÈ ¶óÀ̺귯¸®¸¦ »ç¿ëÇÏ´Â »ç¶÷µµ ÀûÀýÇÑ À§Ä¡¿¡ ÀÖ´Â ÀûÇÕÇÑ ÆÄÀÏÀ̸§°ú architecture À̸§À¸·Î ¹Ù²Ù´Â ÀÛ¾÷¸¸À¸·Î ÀÌ ¹®¼­ÀÇ Á¤º¸¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÌ ÇÏ¿ìÅõ ¹®¼­ÀÇ ÃֽŠÆÇÀº Linux Documentation Project ÀÇ ÀϺηΠ¾òÀ» ¼ö Àְųª, À§ À§Ä¡¿¡¼­ ¾òÀ» ¼ö ÀÖ´Ù. 1.3. ÀÌ ¹®¼­¿¡¼­ ÃÖ±Ù º¯°æµÈ ³»¿ë ¹öÀü 1.1°ú 1.2¿Í ´Ù¸¥ Á¡: · Added some information to the Reporting bugs section, and updated bug reporting email and gnats addresses. (Changes by Andreas Jaeger) · Updated Credits section. ¹öÀü 1.0°ú 1.1¿Í ´Ù¸¥ Á¡: · Updated glibc version to 2.0.5c. · Added a reference to the Debian libc5 to libc6 ÇÏ¿ìÅõ and Frodo Looijaard's Installing glibc-2 on Linux document. 2. ¼³Ä¡ÇÏ´Â ¹æ¹ýÀ» ¼±ÅÃÇÏÀÚ. glibc¸¦ ¼³Ä¡ÇÏ´Â ¹æ¹ýÀº ¸¹Áö ¾Ê´Ù. ´ç½Åµµ ½ÃÇè»ï¾Æ ¶óÀ̺귯¸®¸¦ ¼³Ä¡ÇÒ¼ö ÀÖ´Ù. Áï ±âº»ÀûÀ¸·Î ÀÌ¹Ì ¼³Ä¡µÇ¾î ÀÖ´Â ¶óÀ̺귯¸®¸¦ »ç¿ëÇÏ¿©¼­ glibc 2¸¦ ¼³Ä¡ÇÑ ÈÄ, ÇÁ·Î±×·¥À» ÄÄÆÄÀÏ ÇÒ ¶§, ´Ù¸¥ ¿É¼ÇÀ» »ç¿ëÇÏ¸é »õ·Î¿î ¶óÀ̺귯¸®(glibc 2)¸¦ ÀÌ¿ëÇÒ ¼ö ÀÖ´Ù. ¹°·Ð ÀÌ·± ¹æ¹ýÀ¸·Î ¼³Ä¡ÇÏ´Â °ÍÀº ¼³Ä¡ ÈÄ glibc¸¦ Á¦°ÅÇÏ´Â °ÍÀº ½±´Ù.-- ÁÖÀÇÇÒ °ÍÀº glibc¿Í ¸µÅ·µÇ¾î¼­ ¸¸µé¾îÁø ÇÁ·Î±×·¥Àº ´õ ÀÌ»ó ½ÇÇàµÇÁö ¾Ê´Â´Ù´Â °ÍÀÌ´Ù.-- glibc¸¦ ½ÇÇè»ï¾Æ »ç¿ëÇÒ·Á¸é ¼Ò½º(source)¸¦ °¡Áö·Î ¶óÀ̺귯¸®¸¦ ÄÄÆÄÀÏÇÏ¸é µÈ´Ù. ÀÌ·± ¼³Ä¡ ¹æ¹ýÀº ``½ÃÇè»ï¾Æ ¼³Ä¡Çϱâ''¿¡¼­ ÀÚ¼¼È÷ ¼³¸íÇß´Ù. ¶Ç ´Ù¸¥ ¼³Ä¡ ¹æ¹ýÀº ÁÖ ¶óÀ̺귯¸®·Î glibc¸¦ »ç¿ëÇϱâ À§ÇÑ ¹æ¹ýÀÌ´Ù. ÀÌ°ÍÀº ´ç½ÅÀÌ ÇÁ·Î±×·¥À» ÄÄÆÄÀÏÇϸé, »õ·Î¿î ÇÁ·Î±×·¥µéÀº ÁÖ·Î glibc¿¡ ¸µÅ·ÀÌ µÈ´Ù. ±×·¯³ª ÄÄÆÄÀÏ ½Ã, ´Ù¸¥ ¿É¼ÇÀ» »ç¿ëÇÏ¸é ±¸ ¶óÀ̺귯¸®¿¡ ¸µÅ·½Ãų ¼ö ÀÖ´Ù. ¹ÙÀ̳ʸ® ÇüÅ·Π¶óÀ̺귯¸®¸¦ ¼³Ä¡ÇÒ ¼ö ÀÖÀ¸¸ç, ¶Ç´Â ½º½º·Î ¶óÀ̺귯¸®¸¦ ÄÄÆÄÀÏ ÇÒ ¼ö ÀÖ´Ù. ¸¸¾à ÃÖÀûÈ­ ¿É¼ÇÀ̳ª ±¸¼º ¿É¼ÇÀ» º¯°æ½ÃÅ°°í ½Í°Å³ª ¾Æ´Ï¸é ¹ÙÀ̳ʸ® ÆÐÅ°Áö¿¡¼­ Á¦°øµÇÁö ¾Ê´Â add- onÀ» »ç¿ëÇÏ·Á°í ÇÑ´Ù¸é, ¼Ò½º ¹èÆ÷ÆÇÀ» ±¸ÇÑ ÈÄ, ÄÄÆÄÀÏ ÇϾßÇÑ´Ù. ÀÌ·± ¼³Ä¡ °úÁ¤Àº ``primary C library·Î ¼³Ä¡Çϱâ''¿¡¼­ ¼³¸íÇß´Ù. Frodo LooijaardÀº glibc¸¦ ¼³Ä¡ÇÒ ¼ö ÀÖ´Â ´Ù¸¥ ¹æ¹ýµµ ¼³¸íÇß´Ù. Áï, glibc¸¦ secondary libary·Î ¼³Ä¡ÇÏ°í, glibc¸¦ »ç¿ëÇÏ¿©¼­ ÄÄÆÄÀÏµÇ°Ô cross compiler¸¦ ¼³Á¤ÇÏ´Â ¹æ¹ýÀÌ´Ù. ÀÌ ¹æ¹ý¿¡ ´ëÇÑ ¼³Ä¡ °úÁ¤Àº ´Ù¼Ò º¹ÀâÇÏÁö¸¸, glibc·Î ¸µÅ·ÇÒ ¶§´Â ½¬¿î ÄÄÆÄÀÏÀ» ÇÒ ¼ö ÀÖ´Ù.(??) ÀÌ ¹æ¹ýÀº ±×ÀÇ site¿¡ ÀÖ´Â Installing glibc-2 on Linux ¹®¼­¿¡ ¼³¸íµÇ¾îÀÖ´Ù. ¸¸¾à ÇöÀç Debian 1.3À» »ç¿ë ÁßÀÌ°í, glibc¸¦ »ç¿ëÇÏ´Â µ¥ºñ¾ÈÀÇ unstable version À¸·Î ¾÷±×·¹À̵带 Çϱ⠽ȴٸé, Debian libc5 to libc6 Mini- HOWTO À» Âü°íÇÏ¿©¼­ µ¥ºñ¾È ÆÐÅ°Áö¸¦ ¾÷±×·¹À̵带 ½Ãų ¼ö ÀÖ´Ù. glibc 2¸¦ Áß¿äÇÑ ½Ã½ºÅÛ¿¡ ¼³Ä¡ÇÏ·Á°í ÇÑ´Ù¸é, ÁÖ ¶óÀ̺귯¸®·Î ¼³Ä¡ÇÏÁö ¸»¶ó. ½ÃÇè»ï¾Æ ¼³Ä¡Çϰųª, ´õ ÁÁÀº °ÍÀº ¿©À¯ÀÖ´Â ½Ã½ºÅÛ¿¡ ¼³Ä¡Çؼ­ Å×½ºÆ®ÇØ º¸¾Æ¶ó. ¼³·É ¹ö±×°¡ ¾ø´ÙÇÏ´õ¶óµµ, ¾î¶² ÇÁ·Î±×·¥Àº ÄÄÆÄÀÏ Çϱâ Àü¿¡ º¯°æµÉ ÇÊ¿ä°¡ Àִµ¥, ÀÌ°ÍÀº ÇÔ¼öÀÇ prototypes°ú typesÀÌ º¯°æµÇ±â ¶§¹®ÀÌ´Ù. 3. library¸¦ ¾ò±â glibc 2 ´Â glibc ÆÐÅ°Áö¿Í 3°³ÀÇ Ãß°¡µÈ ¿É¼± ÆÐÅ°Áö(LinuxThreads, Locale, Crypt)·Î ±¸¼ºµÇ¾î ÀÖ´Ù. ¼Ò½º´Â ´ÙÀ½ À§Ä¡¿¡¼­ ãÀ» ¼ö ÀÖ´Ù. · · · · ¹öÀü 2.0.5cÀº Ãß°¡ÀûÀ¸·Î ÆÐÄ¡°¡ ÇÊ¿äÇÏ´Â µ¥, ÀÌ°ÍÀº ´ÙÀ½ À§Ä¡¿¡¼­ ãÀ» ¼ö ÀÖ´Ù. . ¿ÏÀüÇÑ ÄÄÆÄÀÏ°ú ¼³Ä¡¿¡ ÇÊ¿äÇÑ µð½ºÅ© °ø°£Àº ¾à 150 MB°¡ ÇÊ¿äÇÏ´Ù. ÁÖ¿ä ¶óÀ̺귯¸® ÆÐÅ°Áö¸¸ÀÇ ±âº»ÀûÀÎ ¹ÙÀ̳ʸ® ¼³Ä¡½Ã¿¡´Â ¾à 50 MB°¡ ÇÊ¿äÇÏ´Ù. ¹öÀü 2.0.5c¿¡ ´ëÇÑ ¹ÙÀ̳ʸ® ÆÐÅ°Áö´Â ±¸ÇÒ¼ö ¾øÁö¸¸, ¹öÀü 2.0.5 ¹ÙÀ̳ʸ® ÆÐÅ°Áö´Â i386, alpha, 68k¿ëÀ¸·Î ¹èÆ÷µÇ¸ç, ´ÙÀ½ À§Ä¡¿¡¼­ ¾òÀ» ¼ö ÀÖ´Ù. · Intel x86: · · · Alpha: · · · m68k: · · crypt add-on¿¡ ´ëÇؼ­´Â export restrictionsÀÌ À־, non-US »ç¿ëÀÚ´Â ´ÙÀ½ À§Ä¡¿¡¼­ crypt add-on ÆÐÅ°Áö¸¦ ¾òÀ» ¼ö ÀÖ´Ù. . Red Hat ¹èÆ÷ÆÇÀ» »ç¿ëÇÏ´Â »ç¶÷Àº glibc 2¿ë rpmÀ» ´ÙÀ½ À§Ä¡¿¡¼­ ¾òÀ» ¼ö ÀÖ´Ù. ½Å º£ÆÄ ¹èÆ÷ÆÇÀÎ Red Hat 4.8Àº glibc 2°¡ ÁÖ C ¶óÀ̺귯¸®·Î »ç¿ëµÇ¾ú´Ù. µ¥ºñ¾È ¹èÆ÷ÆÇÀ» »ç¿ëÇÏ´Â »ç¶÷Àº glibc 2ÀÇ ÆÐÅ°Áö¸¦ ´ÙÀ½ À§Ä¡¿¡¼­ ¾òÀ» ¼ö ÀÖ´Ù. , , . ÆÄÀÏÀº libc6À¸·Î À̸§ÀÌ µÇ¾ú´Ù. Glibc 2´Â µ¥ºñ¾ÈÀÇ hamm ¹öÀü¿¡¼­´Â ±âº» ÆÐÅ°ÁöÀÇ ÀϺÎÀ̸ç, µ¥ºñ¾È 2.0ºÎÅÍ´Â ÁÖ libc°¡ µÉ °ÍÀÌ´Ù. 4. ½ÃÇè»ï¾Æ ¼³Ä¡Çϱâ Glibc 2¸¦ ½ÃÇè»ï¾Æ ¼³Ä¡Çϸé, ÄÄÆÄÀÏ ÇÒ ¶§¿¡ Ưº°ÇÑ º¯¼ö¸¦ »ç¿ëÇÏ¿© glibc 2¿¡ ¸µÅ·½ÃÅ°Áö ¾Ê´ÂÇÑ ÀÌ¹Ì ¼³Ä¡µÇ¾î ÀÖ´Â ±âÁ¸ÀÇ ¶óÀ̺귯¸®¿¡ ¸µÅ·ÀÌ µÈ´Ù. ¼³Ä¡ µð·ºÅ丮 À§Ä¡(path)°¡ ¸î ÆÄÀÏ¿¡ Æ÷ÇԵǾî ÄÄÆÄÀϵǹǷΠ, ¼Ò½º·Î ºÎÅÍ ¶óÀ̺귯¸®¸¦ ¼³Ä¡Çؾ߸¸ ÇÑ´Ù. 4.1. ÄÄÆÄÀÏÇϱâ¿Í ¼³Ä¡Çϱâ 4.1.1. ÀüÁ¦ Á¶°Ç · About 150 MB free disk space · GNU make 3.75 · gcc >= 2.7.2 (better 2.7.2.1) · binutils 2.8.1 (for alpha you need a snapshot) · bash-2.0 · autoconf-2.12 (if you change configure.in) RAM 64 MBÀÎ i586@133 ÄÄÇ»ÅÍ¿¡¼­ Ãß°¡ ¶óÀ̺귯¸®(add-ons)Æ÷ÇÔÇÑ Àüü ¶óÀ̺귯¸® ¸¦ ÄÄÆÄÀÏÇϴµ¥ ¼Ò¿ä ½Ã°£Àº ¾à 3½Ã°£À̸ç, i686@2¿¡ ÄÄÇ»ÅÍÀÇ °æ¿ì´Â ¾à 1½Ã°£ 30ºÐ Á¤µµ °É·È´Ù. 4.1.2. ¼Ò½º¸¦ ÃßÃâÇϱ⠼ҽº ÆÄÀÏÀ» ÄÄÆÄÀÏÇϱâ À§Çؼ­´Â Archives¿¡¼­ ¼Ò½º ÆÄÀÏÀ» ÃßÃâÇؾ߸¸ ÇÑ´Ù. ¾Æ·¡¿Í °°ÀÌ ÇÏ¸é µÈ´Ù: tar xzf glibc-2.0.5.tar.gz cd glibc-2.0.5 cat ../glibc-2.0.5-2.0.5c.diff.gz | gzip -d | patch -p0 tar xzf ../glibc-linuxthreads-2.0.5.tar.gz tar xzf ../glibc-crypt-2.0.5.tar.gz tar xzf ../glibc-localedata-2.0.5.tar.gz À§ÀÇ ¹æ¹ýó·³ Çϸé, glibc-2.0.5 µð·ºÅ丮¿¡ linuxthreads, crypt, localeddata µð·ºÅ丮°¡ »ý¼ºµÈ´Ù. ÀÌ·¸°Ô ÇؾßÁö¸¸ configure°¡ Ãß°¡µÈ ¶óÀ̺귯¸® µð·ºÅ丮¸¦ ãÀ» ¼ö ÀÖ´Ù. 4.1.3. Configure¸¦ ½ÇÇàÇϱâ glibc-2.0.5 µð·ºÅ丮¿¡¼­ "compile"À̶õ µð·ºÅ丮¸¦ ¸¸µé°í, cd·Î 'compile' µð·ºÅ丮·Î ¿Â´Ù. ¸ðµç ÀÛ¾÷Àº ÀÌ compile µð·ºÅ丮¿¡¼­ ÀÌ·ç¾îÁø´Ù. mkdir compile cd compile À§ÀÇ °úÁ¤À» ¸¶ÃÆÀ¸¸é, '../configure'À» ½ÇÇà½ÃÅ°¸é µÈ´Ù. Ãß°¡ ÆÐÅ°Áö¸¦ »ç¿ëÇÏ°í ½ÍÀ¸¸é, Ãß°¡ ÆÐÅ°Áö¿¡ ´ëÇÑ ¿É¼Ç(--enable-add-ons <¿¹> --enable-add-ons=linuxthreads,crypt,localedata)À» Æ÷ÇÔ½ÃÄÑ¾ß ÇÑ´Ù. ¶Ç ¼³Ä¡ÇÏ°í ½ÍÀº µð·ºÅ丮¸¦ ¼±ÅÃÇØ¾ß ÇÑ´Ù. º¸Åë ¼³Ä¡ µð·ºÅ丮·Î '/usr/i486-linuxglibc2'À» »ç¿ëÇÑ´Ù. ´ÙÀ½Àº configure lineÀÇ ¿¹ÀÌ´Ù: ../configure --enable-add-ons=linuxthreads,crypt,localedata --prefix=/usr/i486-linuxglibc2 4.1.4. ÄÄÆÄÀÏÇϱâ¿Í ¼³Ä¡Çϱâ ÄÄÆÄÀÏÇÏ°í Á¦´ë·Î µÇ¾ú´ÂÁö È®ÀÎÇÏ´Â ÀýÂ÷´Â ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù: make make check make install 4.2. µ¿Àû·Î´õ(dynamic loader)¸¦ ¾÷±×·¹À̵åÇÏÀÚ. 1. ¸¸µé¾îÁø ld.so¸¦ /lib/ld-linux.so.2·Î ¸µÅ·½ÃŲ´Ù: ln -s /usr/i486-linuxglibc2/lib/ld-linux.so.2 /lib/ld-linux.so.2 This is the only library where the location is fixed once a program is linked, and using a link in /lib will ease upgrading to glibc as your primary C library when the stable version is released. 2. /etc/ld.so.conf ÆÄÀÏÀ» ÆíÁýÇÑ´Ù. ÆÄÀÏÀÇ ¸¶Áö¸· ¶óÀο¡ »õ·Ó°Ô ¸¸µé¾îÁø ¶óÀ̺귯¸® µð·ºÅ丮ÀÇ °æ·Î¸í(path)¸¦ ÀûÀ¸¸é µÈ´Ù. Áï ¿ì¸®°¡ ¼³Ä¡Çß´ø °æ¿ì¿¡´Â '/usr/i486-linuxglibc2/lib'À» ÀûÀ¸¸é µÈ´Ù. (ÁÖÀÇ »çÇ× : 'Àº Àû´Â °ÍÀÌ ¾Æ´Ô.^^) /etc/ld.so.conf ÆÄÀÏÀ» º¯°æÇßÀ¸¸é, ´ÙÀ½°ú °°ÀÌ ½ÇÇàÇØ º¸¶ó. ldconfig -v 4.3. gcc¸¦ configureÇϱ⠼³Ä¡ÀÇ ¸¶Áö¸· ´Ü°è°¡ /usr/lib/gcc-lib¸¦ ¾÷µ¥ÀÌÆ®(update)ÇÏ´Â °ÍÀÌ´Ù. ÀÌ°ÍÀ» ÇؾßÁö¸¸ gcc°¡ ¾î¶»°Ô »õ·Î¿î ¶óÀ̺귯¸®¸¦ »ç¿ëÇÒÁö¸¦ ¾Ë ¼ö ÀÖ´Ù. ¿ì¼± ÀÖ´Â configurationÆÄÀÏÀ» º¹»çÇÑ´Ù. ÇöÀç configurationÀÇ ³»¿ëÀ» ¾Ë±â À§Çؼ­´Â ´ÙÀ½°ú °°ÀÌ ÇÏ¸é µÈ´Ù: % gcc -v Reading specs from /usr/lib/gcc-lib/i486-unknown-linux/2.7.2.2/specs gcc version 2.7.2.2 ÀÌ °æ¿ì´Â ½Ã½ºÅÛÀÌ i486-unknown-linux, 2.7.2.2°¡ ¹öÀüÀÌ´Ù. ´ç½ÅÀÌ ÇؾßÇÒ ÀÏÀº /usr/lib/gcc-lib/ À» »õ·Î¿î Å×½ºÆ® ½Ã½ºÅÛ µð·ºÅ丮·Î º¹»çÇÏ´Â °ÍÀÌ´Ù: º¹»çÇÏ´Â °ÍÀÌ´Ù.: cd /usr/lib/gcc-lib/ cp -r i486-unknown-linux i486-linuxglibc2 ±× ´ÙÀ½ ´ÙÀ½°ú °°ÀÌ Ç϶ó. cd /usr/lib/gcc-lib/i486-linuxglibc2/2.7.2.2 ÀÌ µð·ºÅ丮¿¡¼­ 'specs'ÆÄÀÏÀ» ÆíÁýÇÑ´Ù. Áï specs ÆÄÀϳ»¿¡ /lib/ld- linux.so.1À» /lib/ld-linux.so.2·Î ¹Ù²Û´Ù. ¶Ç %{...:-lgmon} °¡ µé¾î°£ ¸ðµç ¹®ÀåÀ» Áö¿ö¶ó. ¿Ö³Ä¸é glibc´Â profileÇϱâ À§Çؼ­ gmon ¶óÀ̺귯¸®¸¦ »ç¿ëÇÏÁö ¾Ê±â ¶§¹®ÀÌ´Ù. »ùÇà specs ÆÄÀÏÀº ``»ùÇà specs ÆÄÀÏ''´Ü¿ø ¿¡¼­ ãÀ» ¼ö ÀÖ´Ù. 4.4. Çì´õ ÆÄÀÏ ¸µÅ©¸¦ ¾÷µ¥ÀÌÆ®Çϱâ. Çì´õ ÆÄÀÏ ¸µÅ©´Â ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù: cd /usr/i486-linuxglibc2/include ln -s /usr/src/linux/include/linux ln -s /usr/src/linux/include/asm ln -s /usr/X11R6/include/X11 You might also have other libraries such as ncurses which need their header files put in this directory. You should copy or link the files from /usr/include. (Some libraries may need to be recompiled with glibc2 in order to work with it. In these cases, just compile and install the package to /usr/i486-linuxglibc2.) 4.5. ¼³Ä¡µÈ°ÍÀ» Å×½ºÆ®Çϱ⠿켱 ´ÙÀ½°ú °°Àº ÆÄÀÏ(glibc.c)¸¦ ¸¸µç´Ù: #include main() { printf("hello world!\n"); } ±×¸®°í ¿É¼Ç"-b -nostdinc -I/include -I/usr/lib/gcc-lib///include" À» °¡Áö°í ÄÄÆÄÀÏ ÇÑ´Ù. % gcc -b i486-linuxglibc2 -nostdinc -I/usr/i486-linuxglibc2/include -I/usr/lib/gcc-lib/i486-linuxglibc2/2.7.2.2/include glibc.c -o glibc ldd¸¦ ÀÌ¿ëÇÏ¿©¼­ ÇÁ·Î±×·¥ÀÌ glibc2¿¡ ¸µÅ©µÇ¾ú´ÂÁö È®ÀÎÇغ»´Ù: % ldd glibc libc.so.6 => /usr/i486-linuxglibc2/lib/libc-2.0.5.so (0x4000d000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) ÄÄÆÄÀÏÀÌ µÇ°í, ¸µÅ© °úÁ¤µµ Á¤»óÀ̸ç, ½ÇÇà½Ã "hello world!" °¡ Ãâ·ÂÀÌ µÈ´Ù¸é, ¼³Ä¡´Â ¼º°øÀûÀ¸·Î ³¡³­ °ÍÀÌ´Ù. (ÃàÇÏ....^^) 5. Primary C library·Î ¼³Ä¡Çϱâ Glibc 2¸¦ ÁÖ C ¶óÀ̺ê·Î¸®·Î ¼³Ä¡ÇÏ´Â ¹æ¹ýÀ» ¼³¸íÇÏ°Ú´Ù. ÁÖ C ¶óÀ̺귯¸®·Î ¼³Ä¡ ÇÑ´Ù´Â °ÍÀº ´ç½ÅÀÌ ÄÄÆÄÀÏÇÏ´Â ÇÁ·Î±×·¥À» glibc·Î ¸µÅ©µÇ°Ô ÇÏ´Â °ÍÀÌ´Ù. ¹°·Ð, ´Ù¸¥ ¹öÀü¿¡ ¸µÅ©½Ãų·Á¸é ÄÄÆÄÀÏ ¿É¼ÇÀ» Ãß°¡½ÃÄѼ­ ÄÄÆÄÀÏÇÏ¸é µÈ´Ù. ¸¸¾à ´ç½ÅÀÌ ·¹µåÇòÀ̳ª µ¥ºñ¾ÈÀ» »ç¿ëÇÏ°í ÀûÀýÇÑ rpm ÆÄÀÏÀ̳ª deb ÆÄÀÏÀ» ´Ù¿îÇß¾ú´Ù¸é, ·¹µåÇòÀ̳ª µ¥ºñ¾ÈÀÇ ¼³Ä¡ ¾È³»¸¦ ÀÐ¾î º¸¾Æ¶ó. ±×·¯¸é, ¿©±âÀÖ´Â ³»¿ëÀ» ÀÐÁö ¾Ê¾Æµµ µÈ´Ù. 5.1. ¼Ò½º·ÎºÎÅÍ ¶óÀ̺귯¸®¸¦ ¼³Ä¡Çϱ⠿©±â¿¡¼­´Â ¼Ò½º·ÎºÎÅÍ glibc 2¿Í add-ons¸¦ ÄÄÆÄÀÏÇÏ´Â ¹æ¹ýÀ» ¼³¸íÇÏ·Á°í ÇÑ´Ù. ÃÖÀûÈ­ ¿É¼ÇÀ̳ª ±¸¼º ¿É¼ÇÀ» º¯°æÇÏ°í ½Í°Å³ª ¹ÙÀ̳ʸ®¿¡ ¾ø´Â ÆÐÅ°Áö¸¦ »ç¿ëÇÏ·Á°í ÇÒ ¶§ ¶óÀ̺귯¸®¸¦ ÄÄÆÄÀÏÇÒ ÇÊ¿ä°¡ ÀÖ´Ù. 5.1.1. ÀüÁ¦ Á¶°Ç · About 150 MB free disk space · GNU make 3.75 · gcc >= 2.7.2 (better 2.7.2.1) · binutils 2.8.1 (for alpha you need a snapshot) · bash-2.0 · autoconf-2.12 (if you change configure.in) RAM 64 MBÀÎ i586@133 ÄÄÇ»ÅÍ¿¡¼­ Ãß°¡ ¶óÀ̺귯¸®(add-ons)Æ÷ÇÔÇÑ Àüü ¶óÀ̺귯¸® ¸¦ ÄÄÆÄÀÏÇϴµ¥ ¼Ò¿ä ½Ã°£Àº ¾à 3½Ã°£À̸ç, i686@2¿¡ ÄÄÇ»ÅÍÀÇ °æ¿ì´Â ¾à 1½Ã°£ 30ºÐ Á¤µµ °É·È´Ù. 5.1.2. ¼Ò½º¸¦ ÃßÃâÇϱ⠼ҽº ÆÄÀÏÀ» ÄÄÆÄÀÏÇϱâ À§Çؼ­´Â Archives¿¡¼­ ¼Ò½º ÆÄÀÏÀ» ÃßÃâÇؾ߸¸ ÇÑ´Ù. ¾Æ·¡¿Í °°ÀÌ ÇÏ¸é µÈ´Ù: tar xzf glibc-2.0.5.tar.gz cd glibc-2.0.5 cat ../glibc-2.0.5-2.0.5c.diff.gz | gzip -d | patch -p0 tar xzf ../glibc-linuxthreads-2.0.5.tar.gz tar xzf ../glibc-crypt-2.0.5.tar.gz tar xzf ../glibc-localedata-2.0.5.tar.gz À§ÀÇ ¹æ¹ýó·³ Çϸé, glibc-2.0.5 µð·ºÅ丮¿¡ linuxthreads, crypt, localeddata µð·ºÅ丮°¡ »ý¼ºµÈ´Ù. ÀÌ·¸°Ô ÇؾßÁö¸¸ configure°¡ Ãß°¡µÈ ¶óÀ̺귯¸® µð·ºÅ丮¸¦ ãÀ» ¼ö ÀÖ´Ù. 5.1.3. Configure¸¦ ½ÇÇàÇϱâ glibc-2.0.5 µð·ºÅ丮¿¡¼­ "compile"À̶õ µð·ºÅ丮¸¦ ¸¸µé°í, cd·Î 'compile' µð·ºÅ丮·Î ¿Â´Ù. ¸ðµç ÀÛ¾÷Àº ÀÌ compile µð·ºÅ丮¿¡¼­ ÀÌ·ç¾îÁø´Ù. mkdir compile cd compile À§ÀÇ °úÁ¤À» ¸¶ÃÆÀ¸¸é, '../configure'À» ½ÇÇà½ÃÅ°¸é µÈ´Ù. Ãß°¡ ÆÐÅ°Áö¸¦ »ç¿ëÇÏ°í ½ÍÀ¸¸é, Ãß°¡ ÆÐÅ°Áö¿¡ ´ëÇÑ ¿É¼Ç(--enable-add-ons <¿¹> --enable-add-ons=linuxthreads,crypt,localedata)À» Æ÷ÇÔ½ÃÄÑ¾ß ÇÑ´Ù. ¶Ç ¼³Ä¡ÇÏ°í ½ÍÀº µð·ºÅ丮¸¦ ¼±ÅÃÇØ¾ß ÇÑ´Ù. º¸Åë ¼³Ä¡ µð·ºÅ丮·Î '--prefix=/usr'À» »ç¿ëÇÑ´Ù. ´ÙÀ½Àº configure lineÀÇ ¿¹ÀÌ´Ù: ../configure --enable-add-ons=linuxthreads,crypt,localedata --prefix=/usr 5.1.4. ÄÄÆÄÀÏÇϱâ ÄÄÆÄÀÏÇÏ°í Á¦´ë·Î µÇ¾ú´ÂÁö È®ÀÎÇÏ´Â ÀýÂ÷´Â ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù: make make check 5.2. ¼³Ä¡Çϱâ À§ÇÑ Áغñ ÀÛ¾÷Çϱ⠼ҽº·ÎºÎÅÍ ¼³Ä¡Çßµç, ¹ÙÀ̳ʸ® ÆÄÀÏ·Î ¼³Ä¡Çßµç glibc 2¶óÀ̺귯¸® ¼³Ä¡ ÁغñÇϱâ À§Çؼ± ¾î¶² ÆÄÀÏÀ» ¿Å±æ ÇÊ¿ä°¡ ÀÖ´Ù. ÀÌÀ¯´Â ¾ÕÀ¸·Î ÄÄÆÄÀÏ ÇÒ »õ·Î¿î ÇÁ·Î±×·¥À» glibc¿¡ ¸µÅ©½ÃÅ°°í, Á¤ÀûÀ¸·Î ¸µÅ©µÇÁö ¾Ê´Â ±¸ ÇÁ·Î±×·¥Àº ¿©ÀüÈ÷ libc 5¿¡ ÀÇÁ¸ ÇÏ°Ô ÇϱâÀ§Çؼ­ÀÌ´Ù. °í·Î ±¸ ¹öÀü¿¡ µ¤¾î ¾²Áö ¾Ê¾Æ¾ßÇÑ´Ù. 1. ±¸ ÆÄÀÏ(libc 5)À» ÀúÀåÇÒ »õ·Î¿î µð·ºÅ丮¸¦ ¸¸µç´Ù: mkdir -p /usr/i486-linuxlibc5/lib 2. ±¸(libc 5¿ë) Çì´õ ÆÄÀÏÀ» /usr/include ¿¡¼­ ´Ù¸¥ µð·ºÅ丮·Î ¿Å±ä´Ù: mv /usr/include /usr/i486-linuxlibc5/include 3. »õ·Î¿î(glibc 2¿ë) include µð·ºÅ丮¸¦ ¸¸µé°í, ´Ù¸¥ include¿¡ ¸µÅ©½ÃŲ´Ù: mkdir /usr/include ln -s /usr/src/linux/include/linux /usr/include/linux ln -s /usr/src/linux/include/asm /usr/include/asm ln -s /usr/X11R6/include/X11 /usr/include/X11 ln -s /usr/lib/g++-include /usr/include/g++ ¸µÅ©´Â ¹èÆ÷ÆÇ¿¡ µû¶ó¼­ ¾à°£ ´Ù¸¦¼ö ÀÖ´Ù. Àû¾îµµ ½½·º¿þ¾îÀÇ °æ¿ì /usr/local/g++-include¿¡ g++ Çì´õÆÄÀÏÀÌ ÀÖ°í, ¹Ý¸é¿¡ µ¥ºñ¾È ÆÐÅ°Áö °æ¿ì /usr/include/g++¿¡ g++Çì´õÆÄÀÏÀÌ ÀÖ°í, /usr/lib/g++-include´Â /usr/include/g++ ¿¡ ¸µÅ©µÇ¾î ÀÖ´Ù. ÈÄÀÚÀÇ °æ¿ì, ¾Æ¸¶ ´ç½ÅÀº ¿ø·¡ g++ include µð·ºÅ丮¸¦ /usr/include¿¡ ¿Å±â±æ ¿øÇÒ °ÍÀÌ´Ù. 4. ´Ù¸¥ Çì´õ ÆÄÀÏÀ» º¹¿øÇÏ°í ¸µÅ©ÇÑ´Ù. ¾î¶² ºñÇ¥ÁØ ¶óÀ̺귯¸®°æ¿ì, ¿¹·Î ncureses, /usr/include¿¡ Çì´õÆÄÀÏÀ» ³õ°Å³ª /usr/include ¹Ø¿¡ ÀÖ´Â ±×µéÀÇ include µð·ºÅ丮¿¡ ¸µÅ©¸¦ ÇÑ´Ù. ÀÌ ÆÄÀϵéÀ̳ª ¸µÅ©´Â ´Ù¸¥ ¶óÀ̺귯¸®¸¦ ÀûÀýÈ÷ »ç¿ëµÉ¼ö ÀÖ°Ô º¹¿øÀ» ÇØ µÑ ÇÊ¿ä°¡ ÀÖ´Ù. 5. /etc/ld.so.confÆÄÀÏ ¸ÇÀ§¿¡ glibc 2¿ë ¶óÀ̺귯¸® µð·ºÅ丮(¿¹, / usr/i486-linuxlibr/lib)¸¦ Ãß°¡ÇÑ´Ù. glibc¸¦ ¼³Ä¡ÇÒ ¶§ ÀÌ»óÇÑ ¸Þ¼¼Áö¸¦ ÇÇÇϱâ À§Çؼ­´Â ld.so-1.8.8ÀÌ»óÀÇ ¹öÀüÀ» ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù. 6. ±¸ C ¶óÀ̺귯¸®¸¦ »õ·Î¿î µð·ºÅ丮(/usr/i486-linuxlibc5/lib)·Î ¿Å±â°Å³ª º¹»çÇÑ´Ù. mv /usr/lib/libbsd.a /usr/i486-linuxlibc5/lib mv /usr/lib/libc.a /usr/i486-linuxlibc5/lib mv /usr/lib/libgmon.a /usr/i486-linuxlibc5/lib mv /usr/lib/libm.a /usr/i486-linuxlibc5/lib mv /usr/lib/libmcheck.a /usr/i486-linuxlibc5/lib mv /usr/lib/libc.so /usr/i486-linuxlibc5/lib mv /usr/lib/libm.so /usr/i486-linuxlibc5/lib cp /lib/libm.so.5.* /usr/i486-linuxlibc5/lib cp /lib/libc.so.5.* /usr/i486-linuxlibc5/lib ¸¸¾à /usrÀÌ /¿Í ´Ù¸¥ ÆÄƼ¼Ç¿¡ ÀÖ´Ù¸é, libm.so.5¿Í libc.so.5´Â move°¡ ¾Æ´Ñ º¹»çµÇ¾î¾ß ÇÑ´Ù. ÀÌÀ¯´Â ¸®´ª½º¸¦ ½ÃÀÛÇϴµ¥ ÇÊ¿äÇÑ ÇÁ·Î±×·¥ÀÌ libm.so.5¿Í libc.so.5¸¦ »ç¿ëÇϱ⶧¹®ÀÌ°í À̰͵éÀº ·çÆ® µð·ºÅ丮¿¡ ÀÖ¾î¾ß¸¸ ÇÑ´Ù. 7. /usr/lib/*.o ÆÙÀÏÀ» »õ·Î¿î µð·ºÅ丮·Î ¿Å±ä´Ù. mv /usr/lib/crt1.o /usr/i486-linuxlibc5/lib mv /usr/lib/crti.o /usr/i486-linuxlibc5/lib mv /usr/lib/crtn.o /usr/i486-linuxlibc5/lib mv /usr/lib/gcrt1.o /usr/i486-linuxlibc5/lib 8. ´ç½ÅÀÇ ¶óÀ̺귯¸®¸¦ ¿Å°åÀ¸¸é ¶óÀ̺귯¸® cache¸¦ ¾÷µ¥ÀÌÆ®ÇÑ´Ù. ldconfig -v 5.3. ¹ÙÀ̳ʸ® ÆÐÅ°Áö·ÎºÎÅÍ ¼³Ä¡Çϱ⠹̸® ÄÄÆÄÀÏµÈ ¹ÙÀ̳ʸ®·ÎºÎÅÍ glibc¸¦ ¼³Ä¡ÇÏ°íÀÚ Çϸé, ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù: cd / gzip -dc glibc-2.0.bin.i386.tar.gz | tar tvvf - gzip -dc glibc-crypt-2.0.bin.i386.tar.gz | tar tvvf - ldconfig -v ´Ù¸¥ architecture³ª ´Ù¸¥ ¹öÀüÀ» °¡Áö°í ÀÖ´Ù¸é, ÀûÀýÇÑ ÆÄÀÏ À̸§À¸·Î ¹Ù²Ù¸é µÈ´Ù. 5.4. ¼Ò½º·ÎºÎÅÍ ¼³Ä¡Çϱ⠼ҽº·ÎºÎÅÍ ¶óÀ̺귯¸®¸¦ ¼³Ä¡ÇÏ·Á¸é, ´ÙÀ½À» ½ÇÇàÇ϶ó: make install ldconfig -v 5.5. gcc specs À» ¾÷µ¥ÀÌÆ®Çϱ⠹ÙÀ̳ʸ®·ÎºÎÅÍ ¼³Ä¡ÀÌµç ¼Ò½º·ÎºÎÅÍ ¼³Ä¡ÇÏµç ¸¶Áö¸· ´Ü°è´Â gcc specs ÆÄÀÏÀ» ¾÷µ¥ÀÌÆ®ÇÏ´Â °ÍÀÌ´Ù. ±×·¡¾ß¸¸ ´ç½Å ÇÁ·Î±×·¥ÀÌ ÀûÀýÇÏ°Ô ¸µÅ©µÉ ¼ö ÀÖ´Ù. gcc°¡ »ç¿ëÇÏ´Â specs ÆÄÀÏÀ» ¾Ë¾Æ³»±â À§Çؼ­´Â ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù: % gcc -v reading specs from /usr/lib/gcc-lib/i486-unknown-linux/2.7.2.2/specs gcc version 2.7.2.2 ÀÌ °æ¿ì´Â i486-unknown-linux ½Ã½ºÅÛÀÌ°í ¹öÀüÀÌ 2.7.2.2ÀÌ´Ù. ´ç½ÅÀÌ ÇؾßÇÒ ÀÏÀº /usr/lib/gcc-lib/À» ±¸ ½Ã½ºÅÛ µð·ºÅ丮·Î º¹»çÇÏ´Â °ÍÀÌ´Ù: cd /usr/lib/gcc-lib/ cp -r i486-unknown-linux i486-linuxlibc5 ±× ´ÙÀ½ ´ÙÀ½°ú °°ÀÌ Ç϶ó. cd /usr/lib/gcc-lib/i486-unknown-linux/2.7.2.2 ÀÌ µð·ºÅ丮¿¡¼­ 'specs'ÆÄÀÏÀ» ÆíÁýÇÑ´Ù. Áï specs ÆÄÀϳ»¿¡ /lib/ld- linux.so.1À» /lib/ld-linux.so.2·Î ¹Ù²Û´Ù. ¶Ç %{...:-lgmon} °¡ µé¾î°£ ¸ðµç ¹®ÀåÀ» Áö¿ö¶ó. ¿Ö³Ä¸é glibc´Â profileÇϱâ À§Çؼ­ gmon ¶óÀ̺귯¸®¸¦ »ç¿ëÇÏÁö ¾Ê±â ¶§¹®ÀÌ´Ù. »ùÇà specs ÆÄÀÏÀº ``»ùÇà specs ÆÄÀÏ''´Ü¿ø¿¡¼­ ãÀ» ¼ö ÀÖ´Ù. 5.6. ¼³Ä¡µÈ°ÍÀ» Å×½ºÆ®Çϱ⠿켱 ´ÙÀ½°ú °°Àº ÆÄÀÏ(glibc.c)¸¦ ¸¸µç´Ù: #include main() { printf("hello world!\n"); } ±×¸®°í ÄÄÆÄÀÏÇÑ´Ù. % gcc glibc.c -o glibc ldd¸¦ ÀÌ¿ëÇÏ¿©¼­ ÇÁ·Î±×·¥ÀÌ glibc2¿¡ ¸µÅ©µÇ¾ú´ÂÁö È®ÀÎÇغ»´Ù: % ldd glibc libc.so.6 => /lib/libc.so.6 (0x4000e000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) ÄÄÆÄÀÏÀÌ µÇ°í, ¸µÅ© °úÁ¤µµ Á¤»óÀ̸ç, ½ÇÇà½Ã "hello world!" °¡ Ãâ·ÂÀÌ µÈ´Ù¸é, ¼³Ä¡´Â ¼º°øÀûÀ¸·Î ³¡³­ °ÍÀÌ´Ù. (ÃàÇÏ....^^) 6. non-primary libc·Î ÄÄÆÄÀÏÇϱâ ÇÁ·Î±×·¥À» ÄÄÆÄÀÏ ÇÏ´Ù º¸¸é, ´Ù¸¥ ¶óÀ̺귯¸®¸¦ »ç¿ëÇÏ°í ½ÍÀº ¶§°¡ ÀÖÀ» °ÍÀÌ´Ù. ÀÌ ´Ü¿ø¿¡¼­´Â ¾î¶»°Ô ÇÏ¸é ´Ù¸¥ ¶óÀ̺귯¸®¸¦ »ç¿ëÇÒ ¼ö Àִ°¡¸¦ ¼³¸íÇÑ´Ù. ¿ì¼± ±â¾ïÇØ¾ß ÇÒ °ÍÀº ¾ÕÀÇ µÎ ´Ü¿ø¿¡¼­ ¿¹·Î »ç¿ëµÇ¾ú´ø µð·ºÅ丮 À̸§°ú ¼³Ä¡ À̸§À» »ç¿ëÇÑ´Ù´Â °ÍÀÌ´Ù. Remember to change the names to fit your setup. 6.1. non-primary libcs »ç¿ëÇÒ ¶§ °æ°í ½Ã½ºÅÛ ºÎÆà °úÁ¤¿¡ »ç¿ëµÇ´Â ÇÁ·Î±×·¥À» ÄÄÆÄÀÏ ÇÒ ¶§ ±â¾ïÇÒ °ÍÀº, ±× ÇÁ·Î±×·¥À» µ¿ÀûÀ¸·Î ¸µÅ©ÇÏ°í non-root ÆÄƼ¼ÇÀÌ ¸¶¿îÆ®µÇ±â ÀÌÀü¿¡ »ç¿ëÇÑ´Ù¸é, ¸ðµç ¸µÅ©µÇ´Â ¶óÀ̺귯¸®´Â root ÆÄƼ¼Ç¿¡ ÀÖ¾î¾ß¸¸ ÇÑ´Ù´Â °ÍÀÌ´Ù. glibc¸¦ ÁÖ C ¶óÀ̺귯¸®·Î ¼³Ä¡ÇÏ´Â °úÁ¤(¾Õ ´Ü¿ø)À» Çß´Ù¸é, ±¸ libc´Â /lib¿¡ ÀÖ´Ù. /lib´Â root ÆÄƼ¼Ç¿¡ ÀÖ¾î¾ßÇÑ´Ù. ÀÌ°ÍÀº ¾ÆÁ÷µµ ¸ðµç ´ç½Å ÇÁ·Î±×·¥ÀÌ ºÎÆÃÇÏ´Â µ¿¾È¿¡´Â ÀÛµ¿ÇÑ´Ù´Â °ÍÀÌ´Ù. ±×·¯³ª, ¸¸¾à /usrÀÌ ´Ù¸¥ ÆÄƼ¼Ç¿¡ ÀÖ°í, glibc¸¦ /usr/i486-linuxglibc2¿¡ ¿¬½À¿ëÀ¸·Î ¼³Ä¡Çß´Ù¸é, glibc¿Í ÇÔ²² ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥µéÀº /usr ÆÄƼ¼ÇÀÌ ¸¶¿îÆ®µÇ±â ÀÌÀü±îÁö´Â ÀÛµ¿ÇÏÁö ¾Ê´Â´Ù´Â °ÍÀÌ´Ù. 6.2. ¿¬½À¿ë glibc¿Í ÇÔ²² ÄÄÆÄÀÏÇϱâ. ¿¬½À¿ë glibc¿Í ÇÔ²² ÇÁ·Î±×·¥À» ÄÄÆÄÀÏÇϱâÀ§Çؼ± glibc include¿¡ include path ¸¦ ´Ù½Ã ¼³Á¤ÇÒ ÇÊ¿ä°¡ ÀÖ´Ù. Specifying "-nostdinc" will negate the normal paths, and "-I/usr/i486-linuxglibc2/include" will point to the glibc includes. You will also need to specify the gcc includes, which are found in /usr/lib/gcc-lib/i486-linuxglibc2/2.7.2.2/include (assuming you installed the test lib in i486-linuxglibc2 with gcc version 2.7.2.2). To link a program with a test-install glibc, you need to specify the gcc setup. This is done by using the option "-b i486-linuxglibc2". For most programs, you can specify these new options by adding them to the CFLAGS and LDFLAGS makefile options: CFLAGS = -nostdinc -I/usr/i486-linuxglibc2/include -I/usr/lib/gcc-lib/i486-linuxglibc2/2.7.2.2/include -b i486-linuxglibc2 LDFLAGS = -b i486-linuxglibc2 If you are using a configure script, define the CFLAGS and LDFLAGS shell variables (by using env/setenv for csh/tcsh, or set/export for sh/bash/etc) before running configure. The makefiles generated by this should contain the proper CFLAGS and LDFLAGS. Not all configure scripts will pick up the variables, so you should check after running configure and edit the makefiles by hand if necessary. If the programs you are compiling only call gcc (and not cpp or binutils directly), you can use the following script to save having to specify all of the options each time: #!/bin/bash /usr/bin/gcc -b i486-linuxglibc2 -nostdinc \ -I/usr/i486-linuxglibc2/include \ -I/usr/lib/gcc-lib/i486-linuxglibc2/2.7.2.2/include "$@" You can then use this script instead of "gcc" when compiling. 6.3. Compiling programs with libc 5 when glibc is primary library To compile a program with your old libraries when you have installed glibc as your main library, you need to reset the include paths to the old includes. Specifying "-nostdinc" will negate the normal paths, and "-I/usr/i486-linuxlibc5/include" will point to the glibc includes. You must also specify "-I/usr/lib/gcc- lib/i486-linuxlibc5/2.7.2.2/include" to include the gcc specific includes. Remember to adjust these paths based on the what you named the new directories and your gcc version. To link a program with your old libc, you need to specify the gcc setup. This is done by using the option "-b i486-linuxlibc5". For most programs, you can specify these new options by appending them to the CFLAGS and LDFLAGS makefile options: CFLAGS = -nostdinc -I/usr/i486-linuxlibc5/include -I/usr/lib/gcc-lib/i486-linuxlibc5/2.7.2.2/include -b i486-linuxlibc5 LDFLAGS = -b i486-linuxlibc5 If you are using a configure script, define the CFLAGS and LDFLAGS shell variables (by using env/setenv for csh/tcsh, or set/export for sh/bash/etc) before running configure. The makefiles generated by this should contain the proper CFLAGS and LDFLAGS. Not all configure scripts will pick up the variables, so you should check after running configure and edit the makefiles by hand if necessary. If the programs you are compiling only call gcc (and not cpp or binutils directly), you can use the following script to save having to specify all of the options each time: #!/bin/bash /usr/bin/gcc -b i486-linuxlibc5 -nostdinc \ -I/usr/i486-linuxlibc5/include \ -I/usr/lib/gcc-lib/i486-linuxlibc5/2.7.2.2/include "$@" You can then use this script instead of "gcc" when compiling. 7. C++ ÇÁ·Î±×·¥À» ÄÄÆÄÀÏÇϱâ libg++´Â ¼öÇÐ ¶óÀ̺귯¸®ÀÇ ÀϺθ¦ »ç¿ëÇϹǷΠlibmÀ» ¸µÅ©½ÃÄѾßÇÑ´Ù. ±âÁ¸ÀÇ libg++´Â ±¸ ¶óÀ̺귯¸®¿Í ÇÔ²² ÄÄÆĵǾú±â¶§¹®¿¡, glibc¿Í ´Ù½Ã ÄÄÆÄÀÏ Çϰųª ¾Æ´Ï¸é ¹ÙÀ̳ʸ®¸¦ ¾ò¾î¾ßÇÑ´Ù. glibc¿¡ ¸µÅ©µÈ ¹ÙÀ̳ʸ® libg++´Â ´ÙÀ½ À§Ä¡¿¡¼­ ãÀ» ¼ö ÀÖ´Ù. . 7.1. ¿¬½À¿ë glibc ¼³Ä¡ÀÇ °æ¿ì¿¡ ´ëÇÑ libg++¼³Ä¡Çϱ⠿¬½À¿ëÀ¸·Î glibc¸¦ ¼³Ä¡Çß´Ù¸é, libg++ÆÄÀÏÀ» glibc°¡ ¼³Ä¡µÇ¾ú´ø µð·ºÅ丮¿¡ ¼³Ä¡ÇؾßÇÑ´Ù. (¾ÕÀÇ ´Ü¿ø´ë·Î Çß´Ù¸é, /usr/i486-linuxglibc2¿¡ libg++ÆÄÀÏÀ» ¼³Ä¡ÇÑ´Ù.) ¹ÙÀ̳ʸ® ÆÐÅ°Áö·ÎºÎÅÍ ¼³Ä¡ÇÏ°íÀÚ ÇÑ´Ù¸é, Àӽà µð·ºÅ丮¿¡¼­ ÆÄÀϳ»¿ëÀ» ÃßÃâÇÑ ´ÙÀ½ usr/lib/ÆÄÀϵéÀ» /lib/ µð·ºÅ丮·Î ¿Å±â°í, usr/include/ÆÄÀϵéÀ» /include/ µð·ºÅ丮·Î ¿Å±ä´Ù. (ÁÖÀÇ »çÇ×: include/g++ ¸µÅ©¸¦ ¸ÕÀú Áö¿ö¶ó), ±×¸®°í usr/bin/ÆÄÀÏÀ» /bin/ µð·ºÅ丮·Î ¿Å±ä´Ù. 7.2. ÁÖ glibc ¼³Ä¡ÀÇ °æ¿ì¿¡ ´ëÇÑ libg++ ¼³Ä¡Çϱâ ÁÖ ¶óÀ̺귯¸®·Î glibc¸¦ ¼³Ä¡Çß´Ù¸é, ¸ÕÀú ±¸ libg++ ÆÄÀϵéÀ» ±¸ libc µð·ºÅ丮·Î ¿Å°Ü¶ó. (g++ÇÁ·Î±×·¥À» ±¸ libc ¿Í ÄÄÆÄÀÏÇÏ°í ½Í´Ù¸é,...) ÀÌ°ÍÀ» Çϴµ¥ °¡Àå ½¬¿î ¹æ¹ýÀº libc 5·Î ÄÄÆÄÀÏµÈ libg++ÀÇ »õ·Î¿î º¹»çÆÇÀ» ¼³Ä¡ÇÏ°í(¾ÕÀÇ ´Ü¿ø¿¡¼­ ¼³¸íÇß´Ù), Á¤»óÀûÀ¸·Î glibc ¹öÀüÀ» ¼³Ä¡ÇÑ´Ù. 7.3. non-primary libc·Î C++ÇÁ·Î±×·¥ ÄÄÆÄÀÏÇϱâ C++ ÇÁ·Î±×·¥À» non-primary libc¿Í ÄÄÆÄÀÏÇÏ°í ½ÍÀ¸¸é, g++ include µð·ºÅ丮¸¦ Æ÷ÇÔ½ÃÄѾßÇÑ´Ù. (Áï ¿¬½À¿ë ¼³Ä¡ °æ¿ì, /usr/i486-linuxglibc2/include/g++ÀÌ°í, ÁÖ glibc ¼³Ä¡ °æ¿ì´Â /usr/i486-linuxlibc5/include/g++ÀÌ´Ù) º¸Åë CXXFLAGS º¯¼ö¸¦ ÷°¡ÇÏ´Â ¹æ¹ýÀ¸·Î »ç¿ëÇÒ ¼ö ÀÖ´Ù. CXXFLAGS = -nostdinc -I/usr/i486-linuxglibc2/include -I/usr/lib/gcc-lib/i486-linuxglibc2/2.7.2.2/include -I/usr/i486-linuxlibc5/include/g++ -b i486-linuxglibc2 8. ¹ö±× º¸°íÇϱâ lib¿¡ ¹ö±×°¡ ÀÖ´Ù°í »ý°¢µÇ¸é, ¿ì¼± FAQ¸¦ Àо¶ó. ´Ù¸¥ »ç¶÷µéÀÌ °¡Áø ¹®Á¦Á¡°ú °°Àº °æ¿ì¶ó¸é ÇØ°áÃ¥ÀÌ ÀÖ´Ù. ¶Ç´Â INSTALL ÆÄÀÏ¿¡ ÀÖ´Â "Recommended Tools to Install the GNU C Library" ´Ü¿øÀ» üũÇØ º¸¾Æ¶ó. ÀÌÀ¯´Â ¾î¶² ¹ö±×´Â glibcÀÇ ¹ö±×°¡ ¾Æ´Ñ toolsÀÇ ¹ö±×À̱⶧¹®ÀÌ´Ù. ÀÏ´Ü ¹ö±×¸¦ ¹ß°ßÇßÀ¸¸é, ±×°ÍÀÌ ÁøÂ¥ ¹ö±×ÀÎÁö È®ÀÎÇ϶ó. GNU C ¶óÀ̺귯¸®°¡ ´Ù¸¥ C ¶óÀ̺귯¸®¿Í °°Àº ¹æ¹ýÀ¸·Î ÀÛµ¿ÇÏ´ÂÁö È®ÀÎÇÏ¸é µÈ´Ù. ¸¸¾à ´Ù¸¥ C¶óÀ̺귯 ¸®¿Í °°Àº ¹æ¹ýÀ¸·Î ÀÛµ¿ÇÏÁö ¾ÊÀ¸¸é ¶óÀ̺귯¸®¿¡ ÀÌ»óÀÌ ÀÖ´Â °ÍÀÌ´Ù. ´ÙÀ½Àº ·Î Á¢¼ÓÇÑ ÈÄ, ¹ö±× µ¥ÀÌŸº£À̽º¸¦ °ËÅäÇØ º¸¶ó. ÀÌ¹Ì º¸°íµÇ¾ú´ø ¹®Á¦ÀÎÁö È®ÀÎÇضó. libc¿Í ÇÔ²² ¹èÆ÷µÇ´Â BUGS ÆÄÀϵµ º¸¾Æ¶ó. »õ·Î¿î ¹ö±×¶ó°í »ý°¢ÀÌ µÇ¸é, ±× ¹®Á¦°¡ ÀϾ¼ö ÀÖ´Â °æ¿ì¸¦ Á¼Èú ¼ö ÀÖÀ» ¸¸Å­ Á¼Çô¶ó.(?) C ¶óÀ̺귯¸® °æ¿ì ÇÑ ¶óÀ̺귯¸® ÇÔ¼ö È£Ãâ·Î ÁÙ¿©¼­ º¸°íÇÒ¼ö ÀÖÀ¸¸é ±×·¸°Ô Çضó. ÀÌ°ÍÀÌ ³Ê¿ì ¾î·ÆÁö ¾Ê¾Æ¾ß ÇÑ´Ù. °£´ÜÇÑ Å×½ºÆ® ÆÇÀ» °¡Áö°í ÀÖ´Ù¸é ¹ö±×¸¦ º¸°íÇ϶ó. ´ÙÀ½Àº ¹ö±× º¸°íÇÒ ¶§ Æ÷ÇÔÇØ¾ß ÇÒ ³»¿ëÀÌ´Ù. (1) ¹ö±×°¡ »ý±â´Â test case¿Í °á°úµé. (2) ¸¸¾à ¹ö±× ¿øÀο¡ ´ëÇÑ »ý°¢ÀÌ ÀÖÀ¸¸é, ´ç½ÅÀÇ »ý°¢ (3) ´ç½ÅÀÌ »ç¿ëÇß´ø ½Ã½ºÅÛ Á¾·ù, GNU C ¶óÀ̺귯¸® ¹öÀü,GCC CC ÄÄÆÄÀÏ·¯ ¹öÀü, GNU Binutils ¹öÀü (4) 'configure'¸¦ ½ÇÇà½ÃÄ×À» ¶§ ¸¸µé¾îÁö´Â 'config.status'¿Í 'config.make'ÀÇ ÆÄÀÏ GNU C ¶óÀ̺귯¸®¿¡ ´ëÇÑ ¹ö±× ·¹Æ÷Æ®´Â glibcbug ½© ½ºÅ©¸³Æ®¸¦ »ç¿ëÇؼ­ ·Î º¸³»¶ó. (´Ù¸¥ ÁÖ¼Ò´Â ) ¶Ç´Â ¿¡ ÀÖ´Â GNATS À¥ ÀÎÅÍÆäÀ̽º¸¦ ÅëÇؼ­ Á¦ÃâÇÒ ¼ö ÀÖ´Ù. Á¦¾È°ú Áú¹®Àº ¿¡ ÀÖ´Â ¸ÞÀϸµ ¸®½ºÆ®·Î º¸³»¶ó. ¸¸¾à gnewsgroupÀÎ gnu.bug.glibc¸¦ ÀоÁö ¾Ê¾Ò´Ù¸é, ¿¡ ¹°¾î¼­ ¸®½ºÆ®¿¡ Á¦ÃâÇÒ ¼ö ÀÖ´Ù. ·Î GNU C ¶óÀ̺귯¸®¿¡ ´ëÇÑ ¹ö±× º¸°í¼­¸¦ º¸³»Áö ¸¶¶ó. ±×°÷Àº GNU CC¿¡ ´ëÇÑ ¹ö±× º¸°í¼­¸¦ À§ÇÑ °÷ÀÌ´Ù. GNU CC¿Í GNU C ¶óÀ̺귯¸®´Â ´Ù¸¥ »ç¶÷µé¿¡ ÀÇÇؼ­ °ü¸®µÈ´Ù. 9. »ùÇà specs ÆÄÀÏ ¿©±â¿¡ ÀÖ´Â »ùÇà specsÆÄÀÏÀº glibc 2¿ëÀ̸ç ÄÄÆÄÀÏÇÒ ¶§, ¸µÅ©ÇÒ ¶§ gcc¿¡ ÀÇÇؼ­ »ç¿ëµÇ´Â ÆÄÀÏÀÌ´Ù. ÀÌ ÆÄÀÏÀº /usr/lib/gcc-lib//¿¡ ÀÖ´Ù. ¸¸¾à x86 ½Ã½ºÅÛÀ» »ç¿ëÇÑ´Ù¸é, ÀÌ »ùÇà specs ÆÄÀÏÀ» º¹»çÇÒ ¼ö ÀÖ´Ù. *asm: %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} *asm_final: %{pipe:-} *cpp: %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} *cc1: %{profile:-p} *cc1plus: *endfile: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s *link: -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static}}} *lib: %{!shared: %{pthread:-lpthread} %{profile:-lc_p} %{!profile: -lc}} *libgcc: -lgcc *startfile: %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} *switches_need_spaces: *signed_char: %{funsigned-char:-D__CHAR_UNSIGNED__} *predefines: -D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) *cross_compile: 0 *multilib: . ; 10. Miscellanea 10.1. Further information 10.1.1. Web Pages · FSF's GNU C Library Home Page · Using GNU Libc 2 with Linux · Installing glibc-2 on Linux . · Debian libc5 to libc6 Mini-HOWTO . 10.1.2. Newgroups · comp.os.linux.development.system · comp.os.linux.development.apps · linux.dev.kernel · gnu.bugs.glibc 10.2. Credits Most of this information was stolen from the GNU Libc web page and from Ulrich Drepper's glibc 2 announcement and his comments. Andreas Jaeger provided some of the Reporting bugs section. The following people have provided information and feedback for this document: · Mark Brown · Ulrich Drepper · Scott K. Ellis · Aron Griffis · Andreas Jaeger · Frodo Looijaard · Ryan McGuire · Shaya Potter · Les Schaffer · Andy Sewell · Stephane · Jan Vandenbos Translations of this document are being done by: · French: Olivier Tharan · Japanese: Kazuyuki Okamoto 10.3. Feedback Besides writing this HOWTO, maintaining the glibc 2 for Linux page, and using it on my machine, I have nothing to do with the glibc project. I am far from knowledgeable on this topic, though I try to help with problems mailed to me. I welcome any feedback, corrections, or suggestions you have to offer. Please send them to thrytis@imaxx.net .