iains / gcc-10-branch

[April 2021] 10.3 plus Darwin additions, initial 10.3 Arm64.
GNU General Public License v2.0
7 stars 2 forks source link

Fails on 10.5.8 PPC: darwin-driver.c:376: error #3

Closed barracuda156 closed 2 years ago

barracuda156 commented 2 years ago

I have configured according to your set up here: https://github.com/iains/gcc-6-branch/issues/1#issuecomment-1001223448 Path reset so that nothing of Macports interferes:

36-111:~ svacchanda$ export PATH=/bin:/sbin:/usr/bin:/usr/sbin
36-111:~ svacchanda$ cd /Users/svacchanda/gcc-10-branch/build 
36-111:build svacchanda$ ../configure --prefix=/opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc --build=powerpc-apple-darwin9 --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=all CC=gcc-4.2 CXX=g++-4.2 >conf.txt

configure: WARNING: using in-tree isl, disabling version check
configure: WARNING: GNAT is required to build ada
configure: WARNING: brig not supported for this target
configure: WARNING: d not supported for this target
configure: WARNING: go not supported for this target
configure: WARNING: --enable-host-shared required to build jit
*** This configuration is not supported in the following subdirectories:
     target-libsanitizer target-libvtv target-libphobos target-libgo gnattools gotools target-libada target-libhsail-rt target-zlib target-libffi target-liboffloadmic
    (Any other directories should still work fine.)
rm: conftest.dSYM: is a directory
36-111:build svacchanda$ 
36-111:build svacchanda$ time nice make -j4 STAGE1_CFLAGS="-O1 -pipe -mdynamic-no-pic" STAGE1_CXXFLAGS="-O1 -pipe -mdynamic-no-pic" >b.txt 2>e.txt && time make install >ins.txt

real    15m17.246s
user    44m25.682s
sys 9m16.999s

Here is the end of the e.txt log:

../../gcc/config/darwin-driver.c: In function ‘void darwin_driver_init(unsigned int*, cl_decoded_option**)’:
../../gcc/config/darwin-driver.c:376: error: ‘startswith’ was not declared in this scope
make[3]: *** [darwin-driver.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2
barracuda156 commented 2 years ago

Logs:

b.txt conf.txt config.log e.txt

iains commented 2 years ago

sorry about that - I'd already fixed that - but obviously failed to merge the patch. Updated the branch.

barracuda156 commented 2 years ago

sorry about that - I'd already fixed that - but obviously failed to merge the patch. Updated the branch.

Thank you! I will try again now.

barracuda156 commented 2 years ago

@iains Probably it worked!

36-111:build svacchanda$ /opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc/bin/gcc /Users/svacchanda/Dev/HelloWorld.c  -m64 -o hello
/Users/svacchanda/Dev/HelloWorld.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | main() {
      | ^~~~
36-111:build svacchanda$ ./hello
hello, world
36-111:build svacchanda$ file hello
hello: Mach-O 64-bit executable ppc64

P. S. Initially it stopped due to permission error, as I forgot to run as sudo, after sudo make install it resumed and installed:

36-111:build svacchanda$ time nice make -j4 STAGE1_CFLAGS="-O1 -pipe -mdynamic-no-pic" STAGE1_CXXFLAGS="-O1 -pipe -mdynamic-no-pic" >b.txt 2>e.txt && time make install >ins.txt

real    138m13.521s
user    344m8.693s
sys 64m50.462s
mkdir: /opt/iains: Permission denied
mkdir: /opt/iains: No such file or directory
mkdir: /opt/iains/powerpc-apple-darwin9: No such file or directory
mkdir: /opt/iains: Permission denied
mkdir: /opt/iains: No such file or directory
mkdir: /opt/iains/powerpc-apple-darwin9: No such file or directory
make[1]: *** [installdirs] Error 1
make: *** [install] Error 2

real    0m1.558s
user    0m0.858s
sys 0m0.615s
36-111:build svacchanda$ sudo make install
Password:
iains commented 2 years ago

@iains Probably it worked!

36-111:build svacchanda$ /opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc/bin/gcc /Users/svacchanda/Dev/HelloWorld.c  -m64 -o hello
/Users/svacchanda/Dev/HelloWorld.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | main() {
      | ^~~~
36-111:build svacchanda$ ./hello
hello, world
36-111:build svacchanda$ file hello
hello: Mach-O 64-bit executable ppc64

Yup

P. S. Initially it stopped due to permission error,

Well, you can install it wherever suits your model - what I do is to make /opt/iains owned by me - I never build toolchains with root permissions - so you could (for example) create /opt/barracuda156 and then chown that to yourself and then any future installs do not need sudo..

I would strongly suggest not using /opt/iains :-) since that will clash with any toolchains I package :)

barracuda156 commented 2 years ago

@iains Will I be able to use it as external compiler for building ports within Macports? Since a number of ports that require gcc6+ fail to build as universal (failing for ppc64 with Macports compilers). If yes, how to set it correctly?

I have tried now just to set it in a portfile:

configure.cc  /opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc/bin/gcc
configure.cxx /opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc/bin/g++

And build icu port as universal, but it still failed on ppc64 part with:

/opt/iains/powerpc-apple-darwin9/gcc-10-3-ppc/bin/g++ -dynamiclib -dynamic -pipe -Os -m64 -D_GLIBCXX_USE_CXX11_ABI=0 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -std=c++11    -fvisibility=hidden -Wl,-headerpad_max_install_names -m64    -Wl,-compatibility_version -Wl,67 -Wl,-current_version -Wl,67.1 -install_name /opt/local/lib/libicui18n.67.dylib -o ../lib/libicui18n.67.1.dylib ucln_in.o fmtable.o format.o msgfmt.o umsg.o numfmt.o unum.o decimfmt.o dcfmtsym.o fmtable_cnv.o choicfmt.o datefmt.o smpdtfmt.o reldtfmt.o dtfmtsym.o udat.o dtptngen.o udatpg.o nfrs.o nfrule.o nfsubs.o rbnf.o numsys.o unumsys.o ucsdet.o ucal.o calendar.o gregocal.o timezone.o simpletz.o olsontz.o astro.o taiwncal.o buddhcal.o persncal.o islamcal.o japancal.o gregoimp.o hebrwcal.o indiancal.o chnsecal.o cecal.o coptccal.o dangical.o ethpccal.o coleitr.o coll.o sortkey.o bocsu.o ucoleitr.o ucol.o ucol_res.o ucol_sit.o collation.o collationsettings.o collationdata.o collationtailoring.o collationdatareader.o collationdatawriter.o collationfcd.o collationiterator.o utf16collationiterator.o utf8collationiterator.o uitercollationiterator.o collationsets.o collationcompare.o collationfastlatin.o collationkeys.o rulebasedcollator.o collationroot.o collationrootelements.o collationdatabuilder.o collationweights.o collationruleparser.o collationbuilder.o collationfastlatinbuilder.o listformatter.o ulistformatter.o strmatch.o usearch.o search.o stsearch.o translit.o utrans.o esctrn.o unesctrn.o funcrepl.o strrepl.o tridpars.o cpdtrans.o rbt.o rbt_data.o rbt_pars.o rbt_rule.o rbt_set.o nultrans.o remtrans.o casetrn.o titletrn.o tolowtrn.o toupptrn.o anytrans.o name2uni.o uni2name.o nortrans.o quant.o transreg.o brktrans.o regexcmp.o rematch.o repattrn.o regexst.o regextxt.o regeximp.o uregex.o uregexc.o ulocdata.o measfmt.o currfmt.o curramt.o currunit.o measure.o utmscale.o csdetect.o csmatch.o csr2022.o csrecog.o csrmbcs.o csrsbcs.o csrucode.o csrutf8.o inputext.o wintzimpl.o windtfmt.o winnmfmt.o basictz.o dtrule.o rbtz.o tzrule.o tztrans.o vtzone.o zonemeta.o standardplural.o upluralrules.o plurrule.o plurfmt.o selfmt.o dtitvfmt.o dtitvinf.o udateintervalformat.o tmunit.o tmutamt.o tmutfmt.o currpinf.o uspoof.o uspoof_impl.o uspoof_build.o uspoof_conf.o smpdtfst.o ztrans.o zrule.o vzone.o fphdlimp.o fpositer.o ufieldpositer.o decNumber.o decContext.o alphaindex.o tznames.o tznames_impl.o tzgnames.o tzfmt.o compactdecimalformat.o gender.o region.o scriptset.o uregion.o reldatefmt.o quantityformatter.o measunit.o measunit_extra.o sharedbreakiterator.o scientificnumberformatter.o dayperiodrules.o nounit.o number_affixutils.o number_compact.o number_decimalquantity.o number_decimfmtprops.o number_fluent.o number_formatimpl.o number_grouping.o number_integerwidth.o number_longnames.o number_modifiers.o number_notation.o number_output.o number_padding.o number_patternmodifier.o number_patternstring.o number_rounding.o number_scientific.o number_utils.o number_asformat.o number_mapper.o number_multiplier.o number_currencysymbols.o number_skeletons.o number_capi.o double-conversion-string-to-double.o double-conversion-double-to-string.o double-conversion-bignum-dtoa.o double-conversion-bignum.o double-conversion-cached-powers.o double-conversion-fast-dtoa.o double-conversion-strtod.o string_segment.o numparse_parsednumber.o numparse_impl.o numparse_symbols.o numparse_decimal.o numparse_scientific.o numparse_currency.o numparse_affixes.o numparse_compositions.o numparse_validators.o numrange_fluent.o numrange_impl.o erarules.o formattedvalue.o formattedval_iterimpl.o formattedval_sbimpl.o formatted_string_builder.o -L../lib -licuuc -L../stubdata -licudata -lpthread -lm 
ld: absolute addressing (perhaps -mdynamic-no-pic) used in __ZN6icu_6712FixedDecimal19getFractionalDigitsEdi from plurrule.o not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs
collect2: error: ld returned 1 exit status
gnumake[1]: *** [../lib/libicui18n.67.1.dylib] Error 1
gnumake[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_icu/icu/work/icu/source-ppc64/i18n'
gnumake: *** [all-recursive] Error 2
gnumake: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_icu/icu/work/icu/source-ppc64'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_icu/icu/work/icu/source-ppc64" && /usr/bin/gnumake -j4 -w all VERBOSE=1 
Exit code: 2
Error: Failed to build icu: command execution failed
barracuda156 commented 2 years ago

@iains I would strongly suggest not using /opt/iains :-) since that will clash with any toolchains I package :)

Got it! Where would you recommend to install?

After gcc10 is set correctly I will proceed building your xtools.

P. S. Thanks so much! This is awesome to have newer gcc finally working!

iains commented 2 years ago

so this specific issue is fixed