EDIT: This post is now outdated.
HotFix 1 addresses this issue, and these steps are no longer needed!
I was trying to record the process of submitting an app last Friday. My EDN app was ready for the AppStore. I ran into this:
iPhone/iPod Touch: application executable is missing a required architecture.
At least one of the following architecture(s) must be present: armv7
This happens on the validation step of submitting an app to the AppStore. The reason is that the validation step for AppStore submissions has changed. Support for *only* armv6 is no longer allowed. You have to support armv7, either by itself or have dual support (armv6 and armv7). This is a recent change, since I was able to submit my previous Analog Clock app in late October last year.
I've spent much of the last week trying to solve this problem. I did a bunch of research, but there was no single magic bullet anywhere. I finally cracked it. And here is the solution. I apologize in advance if some steps are missing. I tried to capture every single step I had to take.
STEP 1: Rebuilding iPhoneAll for armv7
Phil Hess has an excellent page that explains this process -
http://web.me.com/macpgmr/ObjP/Xcode4/iOS_5_Parsing_Status.htmlYou don't actually need to parse anything for this purpose. You can jump directly to Phil's Step 4 and build iPhoneAll for armv6/armv7 as follows:
./compile-arm.sh iPhoneAll.pas
Then Phil's Step 5 from the link above (this moves the compiled targets in place):
mv iPhoneAll.o /usr/local/lib/fpc/2.6.0/units/arm-darwin/cocoaint/
mv iPhoneAll.ppu /usr/local/lib/fpc/2.6.0/units/arm-darwin/cocoaint/
mv AnonClassDefinitionsUikit.o /usr/local/lib/fpc/2.6.0/units/arm-darwin/cocoaint/
mv AnonClassDefinitionsUikit.ppu /usr/local/lib/fpc/2.6.0/units/arm-darwin/cocoaint/
STEP 2: Rebuilding the FPC RTL for armv7We'll use the following link as a base line -
http://wiki.freepascal.org/iPhone/iPod_development#Building_an_ARM_Cross-compilerWe need to modify the steps for iOS5.0 as follows:
Jump into Super User mode:
sudo bash
export IPHONEPLATFORMBASEDIR=/Developer/Platforms/iPhoneOS.platform/Developer
make clean
make FPC=/usr/local/lib/fpc/2.6.0/ppc386 CPU_TARGET=arm CROSSOPT="-FD${IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/iPhoneOS5.0.sdk/ -ap -Cparmv7 -Cfvfpv3" all
sudo make FPC=`pwd`/compiler/ppcrossarm OPT="-ap" CPU_TARGET=arm CROSSOPT="-FD${IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/iPhoneOS5.0.sdk/ -ap" install CROSSINSTALL=1
sudo ln -sf ../lib/fpc/2.5.1/ppcrossarm /usr/local/bin/ppcarm
STEP 3. Modify the Run Script for project under Build Phases for your Target in XcodeReplace the -Cfvfpv2 flag with both of these flags -Cparmv7 -Cfvfpv3. A typical excerpt from the Run Script will now say:
/usr/local/lib/fpc/2.6.0/ppcrossarm -gw -g -godwarfsets -Xg -O1 -Cparmv7 -Cfvfpv3 -MDelphi -B -o$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH -Fu/usr/local/lib/fpc/2.6.0/units/arm-darwin/fmi -Fu/Developer/Embarcadero/fmi -Fu/Developer/Embarcadero/fmi/coretext -Fu/Developer/Embarcadero/fmi/fpclib -XR$SDKROOT -FD$PLATFORM_DEVELOPER_BIN_DIR "$PROJECT_DIR/../$PROJECT.pas"
Drop armv6 from Architectures under Build Settings for your Project if it's set.
Good luck!