우분투 20.04 perl patch

우분투 20.04에서 glibc 버전이 변경되어 많은 RDK 레시피에서 빌드 에러가 발생한다. Perl 역시 glibc으로 인해 아래와 같은 에러가 발생한다.

pp.c: In function ‘Perl_pp_crypt’:
pp.c:3628:47: error: ‘struct crypt_data’ has no member named ‘current_saltbits’
 3628 |      PL_reentrant_buffer->_crypt_struct_buffer->current_saltbits = 0;
      |                                               ^~

glibc 2.31 버전에서 current_saltbits 삭제되어 발생한 문제이며, 아래와 같이 패치를 적용하면 빌드에러를 해결할 수 있다.

--- perl-5.22.1_old/pp.c	2015-10-31 05:21:20.000000000 +0900
+++ perl-5.22.1_new/pp.c	2020-11-02 15:42:54.503989135 +0900
@@ -3624,8 +3624,12 @@
 #if defined(__GLIBC__) || defined(__EMX__)
 	if (PL_reentrant_buffer->_crypt_struct_buffer) {
 	    PL_reentrant_buffer->_crypt_struct_buffer->initialized = 0;
-	    /* work around glibc-2.2.5 bug */
+    #if (defined(__GLIBC__) && __GLIBC__ == 2) && \
+        (defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ >= 2 && __GLIBC_MINOR__ < 4)
+	    /* work around glibc-2.2.5 bug, has been fixed at some
+	     * time in glibc-2.3.X */
 	    PL_reentrant_buffer->_crypt_struct_buffer->current_saltbits = 0;
+    #endif	    
 	}
 #endif
     }