Bug 13772 - perl reproducibility issue in perl-dev (host config leaking to target?)
Summary: perl reproducibility issue in perl-dev (host config leaking to target?)
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 3.0
Hardware: x86 Multiple
: High normal
Target Milestone: 3.1 M3
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-02-03 12:15 UTC by Richard Purdie
Modified: 2020-02-08 13:51 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Output of configure with +x (1.20 KB, text/plain)
2020-02-06 17:31 UTC, Jeremy A. Puhlman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2020-02-03 12:15:33 UTC
│ │ ├── ./usr/lib/perl5/5.30.1/x86_64-linux/CORE/config.h
│ │ │ @@ -2317,15 +2317,15 @@
│ │ │  #define HAS_BUILTIN_ADD_OVERFLOW	/**/
│ │ │  #define HAS_BUILTIN_SUB_OVERFLOW	/**/
│ │ │  #define HAS_BUILTIN_MUL_OVERFLOW	/**/
│ │ │  
│ │ │  /* HAS_C99_VARIADIC_MACROS:
│ │ │   *	If defined, the compiler supports C99 variadic macros.
│ │ │   */
│ │ │ -#define	HAS_C99_VARIADIC_MACROS	/**/
│ │ │ +/*#define	HAS_C99_VARIADIC_MACROS	/ **/
│ │ │  
│ │ │  /* HAS_CLASS:
│ │ │   *	This symbol, if defined, indicates that the class routine is
│ │ │   *	available to classify doubles.  Available for example in AIX.
│ │ │   *	The returned values are defined in <float.h> and are:
│ │ │   *
│ │ │   *	FP_PLUS_NORM	Positive normalized, nonzero
│ │ ├── ./usr/lib/perl5/5.30.1/x86_64-linux/CORE/xconfig.h
│ │ │ @@ -2217,17 +2217,17 @@
│ │ │   *	Note that this variable is initialized from the sig_num_init,
│ │ │   *	not from sig_num (which is unused).
│ │ │   */
│ │ │  /* SIG_SIZE:
│ │ │   *	This variable contains the number of elements of the SIG_NAME
│ │ │   *	and SIG_NUM arrays, excluding the final NULL entry.
│ │ │   */
│ │ │ -#define SIG_NAME "ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "IOT", "CLD", "POLL", "UNUSED", 0		/**/
│ │ │ -#define SIG_NUM  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 6, 17, 29, 31, 0		/**/
│ │ │ -#define SIG_SIZE 36			/**/
│ │ │ +#define SIG_NAME "ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "IOT", "CLD", "POLL", 0	/**/
│ │ │ +#define SIG_NUM  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 6, 17, 29, 0		/**/
│ │ │ +#define SIG_SIZE 35			/**/
│ │ │  
│ │ │  /* USE_CROSS_COMPILE:
│ │ │   *	This symbol, if defined, indicates that Perl is being cross-compiled.
│ │ │   */
│ │ │  /* PERL_TARGETARCH:
│ │ │   *	This symbol, if defined, indicates the target architecture
│ │ │   *	Perl has been cross-compiled to.  Undefined if not a cross-compile.
│ │ │ @@ -2317,15 +2317,15 @@
│ │ │  #define HAS_BUILTIN_ADD_OVERFLOW	/**/
│ │ │  #define HAS_BUILTIN_SUB_OVERFLOW	/**/
│ │ │  #define HAS_BUILTIN_MUL_OVERFLOW	/**/
│ │ │  
│ │ │  /* HAS_C99_VARIADIC_MACROS:
│ │ │   *	If defined, the compiler supports C99 variadic macros.
│ │ │   */
│ │ │ -#define	HAS_C99_VARIADIC_MACROS	/**/
│ │ │ +/*#define	HAS_C99_VARIADIC_MACROS	/ **/
│ │ │  
│ │ │  /* HAS_CLASS:
│ │ │   *	This symbol, if defined, indicates that the class routine is
│ │ │   *	available to classify doubles.  Available for example in AIX.
│ │ │   *	The returned values are defined in <float.h> and are:
│ │ │   *
│ │ │   *	FP_PLUS_NORM	Positive normalized, nonzero
│ │ │ @@ -3079,15 +3079,15 @@
│ │ │   *	include <xlocale.h> to get uselocale() and its friends.
│ │ │   */
│ │ │  #define	HAS_NEWLOCALE	/**/
│ │ │  #define	HAS_FREELOCALE	/**/
│ │ │  #define	HAS_USELOCALE	/**/
│ │ │  #define	HAS_DUPLOCALE	/**/
│ │ │  /*#define	HAS_QUERYLOCALE	/ **/
│ │ │ -#define	I_XLOCALE               /**/
│ │ │ +/*#define	I_XLOCALE               / **/
│ │ │  
│ │ │  /* HAS_NEXTAFTER:
│ │ │   *	This symbol, if defined, indicates that the nextafter routine is
│ │ │   *	available to return the next machine representable double from
│ │ │   *	x in direction y.
│ │ │   */
│ │ │  #define HAS_NEXTAFTER		/**/
│ │ │ @@ -3692,15 +3692,15 @@
│ │ │   */
│ │ │  /*#define	I_PROT		/ **/
│ │ │  
│ │ │  /* I_QUADMATH:
│ │ │   *	This symbol, if defined, indicates that <quadmath.h> exists and
│ │ │   *	should be included.
│ │ │   */
│ │ │ -/*#define	I_QUADMATH		/ **/
│ │ │ +#define	I_QUADMATH		/**/
│ │ │  
│ │ │  /* I_SHADOW:
Comment 1 Ross Burton 2020-02-05 14:28:49 UTC
Filed with perl-cross at https://github.com/arsv/perl-cross/issues/87
Comment 2 Richard Purdie 2020-02-05 17:48:25 UTC
Further testing suggests HAS_C99_VARIADIC_MACROS is a dash vs bash issue. Whether that is the only issue, not sure but its one problem.
Comment 3 Richard Purdie 2020-02-05 23:09:41 UTC
Also https://github.com/arsv/perl-cross/issues/88
Comment 4 Jeremy A. Puhlman 2020-02-06 17:31:19 UTC
Created attachment 4630 [details]
Output of configure with +x

It appears at a glance that the problem is the test is using the host compiler to determine if the variadic macros are available.

It is a try and run test.

set try
if eval $compile && $run ./try 2>&1 >/dev/null; then
    case "`$run ./try`" in
    "123 456 789")
    echo "You have C99 variadic macros." >&4
    d_c99_variadic_macros="$define"
    ;;
    *)
    echo "You don't have functional C99 variadic macros." >&4
    d_c99_variadic_macros="$undef"
    ;;
    esac
else
    echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
    d_c99_variadic_macros="$undef"
fi
$rm_try

The output from the configure run with all the output indicates that it is using the host gcc to make the determination.
Comment 5 Jeremy A. Puhlman 2020-02-06 18:33:16 UTC
nm, was looking at the wrong configure code.
Comment 6 Ross Burton 2020-02-06 23:56:22 UTC
HAS_C99_VARIADIC_MACROS is a dash-vs-bash issue and can be fixed by removing a \n.

The rest are in a host-specific file that shouldn't be shipped, Alex has a sent a patch.
Comment 7 Richard Purdie 2020-02-07 00:03:38 UTC
Also seeing 	

HOSTCFLAGS·​=·​-​DPERL_CORE·​-​DUSE_CROSS_COMPILE·​-​D_LARGEFILE_SOURCE·​-​D_FILE_OFFSET_BITS=64​

vs

HOSTCFLAGS·​=·​-​DPERL_CORE·​-​DUSE_CROSS_COMPILE·​-​D_LARGEFILE_SOURCE·​-​D_FILE_OFFSET_BITS=64​·​-​fwrapv·​-​fno-​strict-​aliasing

in ptest/Makefile.config which is another piece of host contamination :(
Comment 8 Richard Purdie 2020-02-07 00:05:00 UTC
(In reply to comment #5)
> nm, was looking at the wrong configure code.

It gets confusing as the configure code runs twice, once for native for building miniperl, then again for the target...