Re: Portability: common-src/amcrc32chw.c & config/amanda/amanda_configure.m4
[email protected] (Eric Schnoebelen)
| Newsgroups | gmane.comp.archivers.amanda.devel |
|---|---|
| Message-ID | <[email protected]> |
Jean-Louis Martineau writes: - This patch is broken, - Must add $SSE42_CFLAGS to CFLAGS before running AC_CHECK_FUNCS for - (-msse4.2 flag) - It still fail to detect the functions. Ok, I will add the appropriate defines to AC_CHECK_FUNCS, and re-submit. As is, it works for my usecase, a system without any gcc __builtin_* functions. - On 02/01/17 02:53 PM, Eric Schnoebelen wrote: - > Issue: Attempting to use gcc __builtin functions without - > appropriate feature tests. Not all platforms use gcc, and not - > all gcc platforms provide the __builtin_ia32_* functions (as not - > all gcc platforms are necessarily x86_*) - > - > Solution: add feature test macros for the __builtin_ia32_* - > functions being used, and wrapper their use with the feature - > test macro. - > - > patches inline and as attachments - > - > - > $NetBSD$ - > - > Add tests for the gcc __builtin_ia32_crc32[qdsu]i functions. - > - > --- config/amanda/amanda_configure.m4.orig=092016-11-23 16:11:15.000000000 +0000 - > +++ config/amanda/amanda_configure.m4 - > @@ -364,8 +364,9 @@ ICE_CHECK_DECL(strcasecmp,string.h strin - > ICE_CHECK_DECL(euidaccess,unistd.h) - > ICE_CHECK_DECL(eaccess,unistd.h) - > ICE_CHECK_DECL(clock_gettime,time.h) - > -AC_CHECK_FUNCS(getservbyname_r) - > +ICE_CHECK_DECL(getservbyname_r, netdb.h) - > AC_CHECK_FUNCS(sem_timedwait) - > +AC_CHECK_FUNCS(__builtin_ia32_crc32qi __builtin_ia32_crc32di __builtin_ia32_crc32si __builtin_ia32_crc32hi) - > - > # - > # Devices - > - > - > $NetBSD$ - > - > Change the test to use a feature test macro for the existance of the - > builtin functions being used. - > - > (bad programmer, using compiler internal routines in public code.) - > - > --- common-src/amcrc32chw.c.orig=092016-11-23 16:11:16.000000000 +0000 - > +++ common-src/amcrc32chw.c - > @@ -29,7 +29,11 @@ - > #include <amutil.h> - > #include <amcrc32chw.h> - > - > -#if defined __GNUC__ && GCC_VERSION > 40300 && (defined __x86_64__ || defined __i386__ || defined __i486__ || defined __i586__ || defined __i686__) - > +#if defined HAVE___BUILTIN_IA32_CRC32QI && \ - > +=09defined HAVE___BUILTIN_IA32_CRC32DI && \ - > +=09defined HAVE___BUILTIN_IA32_CRC32SI && \ - > +=09defined HAVE___BUILTIN_IA32_CRC32UI - > + - > #define POLY 0x82F63B78 - > - > /* Multiply a matrix times a vector over the Galois field of two elements,