clang fatal error while building pfe

Originator:kristopherdjohnson
Number:rdar://24321361 Date Originated:25-Jan-2016 01:49 AM
Status:Open Resolved:
Product:Developer Tools Product Version:7.2 (7C68)
Classification:Serious Bug Reproducible:Always
 
Summary:
While attempting to build PFE (Portable Forth Environment), got this output:

fatal error: error in backend: Invalid register name global variable
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.

Steps to Reproduce:
1. Download pfe source from http://sourceforge.net/projects/pfe/files/latest/download?source=files
2. Extract source files from the tar.bz2
3. Run "configure" and "make"

Expected Results:
Source should build, or the compiler should provide actionable error messages

Actual Results:
Got this output:

fatal error: error in backend: Invalid register name global variable
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/m2/rybssb891754_bh7qlhn1fw80000gp/T/core-sub-b047cd.c
clang: note: diagnostic msg: /var/folders/m2/rybssb891754_bh7qlhn1fw80000gp/T/core-sub-b047cd.sh
clang: note: diagnostic msg: 

Version:
Xcode Version 7.2 (7C68) & OS X 10.11.3 (15D21)

Notes:


Configuration:


Attachments:
'core-sub-b047cd.sh' and 'core-sub-b047cd.c' were successfully uploaded.

Comments

Response from Apple

This is a courtesy email regarding Bug ID# 24321361.

Engineering has provided the following feedback regarding this issue:

Please try this in the latest Xcode beta [7.3 beta 2]. This is no longer a crash, but an error:

In file included from ../../pfe/core-sub.c:25:
In file included from ../../pfe/../pfe/pfe-base.h:20:
In file included from ../../pfe/../pfe/pfe-ext.h:14:
In file included from ../../pfe/../pfe/pfe-sub.h:14:
In file included from ../../pfe/../pfe/def-regs.h:25:
../../pfe/../pfe/def-regth.h:44:38: error: register '%edi' unsuitable for global register variables on this target
register struct p4_Thread* p4TH asm (P4_REGTH);
                                    ^
../../pfe/../pfe/def-regmacro.h:174:36: note: expanded from macro 'P4_REGTH'
#            define P4_REGTH       "%"PFE_i386_EDI
                                  ^
1 error generated.
By kristopherdjohnson at Feb. 1, 2016, 5:46 a.m. (reply...)

Workaround available

The bug can be worked around by building PFE like this:

./configure --without-regs
make
make install
By kristopherdjohnson at Jan. 25, 2016, 7:25 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!