Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest version of php configure fails to compile program that uses 'fopen' #8

Open
MikeFultonDev opened this issue Nov 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@MikeFultonDev
Copy link
Collaborator

configure generates the C test:
conftest.c

#include <stdio.h>
#include <stdlib.h>

typedef union _mm_align_test {
  void *ptr;
  double dbl;
  long lng;
} mm_align_test;

#if (defined (__GNUC__) && __GNUC__ >= 2)
#define ZEND_MM_ALIGNMENT (__alignof__ (mm_align_test))
#else
#define ZEND_MM_ALIGNMENT (sizeof(mm_align_test))
#endif

int main()
{
  size_t i = ZEND_MM_ALIGNMENT;
  int zeros = 0;
  FILE *fp;

  while (i & ~0x1) {
    zeros++;
    i = i >> 1;
  }

  fp = fopen("conftest.zend", "w");
  fprintf(fp, "(size_t)%zu (size_t)%d %d\n", ZEND_MM_ALIGNMENT, zeros, ZEND_MM_ALIGNMENT < 4);
  fclose(fp);

  return 0;
}

and then tries to compile the code. Here is a script that is the same as the compile:
compalign


#!/bin/sh

clang -o conftest -fno-common -Wstrict-prototypes -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -fzos-le-char-mode=ascii -std=gnu11 -mnocsect -fno-short-enums -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -mzos-target=zosv2r4 -O3  -I/home/fultonm/zopen/usr/local/zopen/ncurses/ncurses-6.3.20231105_110138.zos/include -I/home/fultonm/zopen/usr/local/zopen/libiconv/libiconv-1.17.20231019_173613.zos/include -I/home/fultonm/zopen/usr/local/zopen/libxml2/libxml2-2.9.12.20231101_144831.zos/include -I/home/fultonm/zopen/usr/local/zopen/libxml2/libxml2-2.9.12.20231101_144831.zos/include/libxml2 -I/home/fultonm/zopen/usr/local/zopen/sqlite/sqlite-autoconf-3420000.20230913_200825.zos/include -isystem /home/fultonm/zopen/usr/local/zopen/zoslib/zoslib-zopen.20231019_211406.zos/include -include /home/fultonm/zopen/usr/local/zopen/zoslib/zoslib-zopen.20231019_211406.zos/include/zos-v2r5-symbolfixes.h -fvisibility=hidden -DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF  -DZOSLIB_OVERRIDE_CLIB=1 -D_GNU_SOURCE  conftest.c

This fails to link:

 IEW2456E 9207 SYMBOL __fopen_ascii UNRESOLVED.  MEMBER COULD NOT BE INCLUDED
          FROM THE DESIGNATED CALL LIBRARY.
 IEW2665S 40FF MODULE *NULL*  IS NON-EXECUTABLE AND WAS NOT SAVED BECAUSE
          STORENX=NEVER.
IEW5033 The binder ended with return code 12.
clang-14: error: linker command failed with exit code 12 (use -v to see invocation)

@IgorTodorovskiIBM is this a known limitation is zoslib? Is there an issue I should reference there?

@MikeFultonDev MikeFultonDev added the bug Something isn't working label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant