gcc-hyperbolabsd.patch 372 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954
  1. diff --git a/config/target-posix b/config/target-posix
  2. index 2fba066..e87a5a9 100644
  3. --- a/config/target-posix
  4. +++ b/config/target-posix
  5. @@ -1,7 +1,7 @@
  6. case "${target}" in
  7. *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
  8. ;;
  9. - *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
  10. + *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* | *-*-hyperbolabsd*)
  11. ;;
  12. *-*-solaris2* | *-*-hpux11*)
  13. ;;
  14. diff --git a/config/tcl.m4 b/config/tcl.m4
  15. index 4542a4b..9585b4a 100644
  16. --- a/config/tcl.m4
  17. +++ b/config/tcl.m4
  18. @@ -1489,6 +1489,28 @@ dnl AC_CHECK_TOOL(AR, ar)
  19. # FreeBSD doesn't handle version numbers with dots.
  20. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
  21. + TCL_LIB_VERSIONS_OK=nodots
  22. + ;;
  23. + HyperbolaBSD-*)
  24. + # POWER[64] needs -fPIC, -fpic will not do.
  25. + case `machine` in
  26. + arm64|power|power64)
  27. + SHLIB_CFLAGS="-fPIC";;
  28. + *)
  29. + SHLIB_CFLAGS="-fpic";;
  30. + esac
  31. + SHLIB_LD="ld -Bshareable -x"
  32. + SHLIB_LD_LIBS='${LIBS}'
  33. + SHLIB_SUFFIX=".so"
  34. + DL_OBJS="tclLoadDl.o"
  35. + DL_LIBS=""
  36. + LDFLAGS="$LDFLAGS -export-dynamic"
  37. + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  38. + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
  39. + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
  40. +
  41. + # HyperbolaBSD doesn't handle version numbers with dots.
  42. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
  43. TCL_LIB_VERSIONS_OK=nodots
  44. ;;
  45. @@ -2097,7 +2119,7 @@ dnl # preprocessing tests use only CPPFLAGS.
  46. ;;
  47. IRIX*)
  48. ;;
  49. - NetBSD-*|FreeBSD-*|OpenBSD-*)
  50. + NetBSD-*|FreeBSD-*|OpenBSD-*|HyperbolaBSD-*)
  51. ;;
  52. Darwin-*)
  53. ;;
  54. diff --git a/config.guess b/config.guess
  55. index 588fe82..c50b78f 100755
  56. --- a/config.guess
  57. +++ b/config.guess
  58. @@ -1,6 +1,9 @@
  59. #! /bin/sh
  60. # Attempt to guess a canonical system name.
  61. # Copyright 1992-2018 Free Software Foundation, Inc.
  62. +#
  63. +# Modifications to support HyperbolaBSD:
  64. +# Copyright (C) 2020-2024 Hyperbola Project
  65. timestamp='2018-01-01'
  66. @@ -240,6 +243,95 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  67. UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
  68. echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
  69. exit ;;
  70. + *:HyperbolaBSD:*:*)
  71. + sysctl_ma="sysctl -n hw.machine"
  72. + UNAME_MACHINE_ARCH=`(/sbin/$sysctl_ma 2>/dev/null || \
  73. + /usr/sbin/$sysctl_ma 2>/dev/null || echo unknown)`
  74. + sysctl_mo="sysctl -n hw.model"
  75. + UNAME_MODEL_ARCH=`(/sbin/$sysctl_mo 2>/dev/null || \
  76. + /usr/sbin/$sysctl_mo 2>/dev/null || echo unknown)`
  77. + format=
  78. + case "${UNAME_MACHINE_ARCH}" in
  79. + amd64) machine=x86_64 ;;
  80. + arm64)
  81. + eval $set_cc_for_build
  82. + if echo BIG_ENDIAN | $CC_FOR_BUILD -E - 2>/dev/null \
  83. + | grep -q BIG_ENDIAN
  84. + then
  85. + machine=aarch64_be
  86. + else
  87. + machine=aarch64
  88. + fi
  89. + ;;
  90. + armv7)
  91. + eval $set_cc_for_build
  92. + if echo BIG_ENDIAN | $CC_FOR_BUILD -E - 2>/dev/null \
  93. + | grep -q BIG_ENDIAN
  94. + then
  95. + machine=armv7b
  96. + else
  97. + machine=armv7l
  98. + fi
  99. + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
  100. + | grep -q __ARM_EABI__
  101. + then
  102. + format=
  103. + else
  104. + format=eabihf
  105. + fi
  106. + ;;
  107. + i386|ia32|x86_32)
  108. + case "${UNAME_MODEL_ARCH}" in
  109. + *'686'*|*'Pentium Pro'*|*'Pentium ||'*|*'Pentium 2'*| \
  110. + *'Pentium 3'*|*'Pentium 4'*|*'Pentium M'*| \
  111. + *'Pentium D'*|*'Core'*|*'Xeon'*|*'Tolapai'*| \
  112. + *'Celeron'*|*'Atom'*|*'Stealey'*|*'A100'*|*'A110'*| \
  113. + *'6x86'*|*'K6'*|*'Athlon'*|*'Duron'*| \
  114. + *'Cyrix M'*|*'MediaGX'*|*'Jedi'*|*'Gobi'*|*'Jalapeno'*| \
  115. + *'VIA'*|*'C3'*|*'C7'*|*'Eden'*)
  116. + machine=i686 ;;
  117. + *'586'*|*'Pentium'*|*'Quark'*| \
  118. + *'5x86'*|*'K5'*|*'Geode'*|*'SC5'*)
  119. + machine=i586 ;;
  120. + *'486'*|*'DX4'*|*'OverDrive'*|*'SC4'*)
  121. + machine=i486 ;;
  122. + *) machine=i386 ;;
  123. + esac
  124. + ;;
  125. + power)
  126. + eval $set_cc_for_build
  127. + if echo LITTLE_ENDIAN | $CC_FOR_BUILD -E - 2>/dev/null \
  128. + | grep -q LITTLE_ENDIAN
  129. + then
  130. + machine=powerpc
  131. + else
  132. + machine=powerpcle
  133. + fi
  134. + ;;
  135. + power64)
  136. + eval $set_cc_for_build
  137. + if echo LITTLE_ENDIAN | $CC_FOR_BUILD -E - 2>/dev/null \
  138. + | grep -q LITTLE_ENDIAN
  139. + then
  140. + machine=powerpc64
  141. + else
  142. + machine=powerpc64le
  143. + fi
  144. + ;;
  145. + riscv64)
  146. + eval $set_cc_for_build
  147. + if echo BIG_ENDIAN | $CC_FOR_BUILD -E - 2>/dev/null \
  148. + | grep -q BIG_ENDIAN
  149. + then
  150. + machine=riscv64be
  151. + else
  152. + machine=riscv64
  153. + fi
  154. + ;;
  155. + *) machine=${UNAME_MACHINE_ARCH} ;;
  156. + esac
  157. + echo ${machine}-unknown-hyperbolabsd${format}
  158. + exit ;;
  159. *:LibertyBSD:*:*)
  160. UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
  161. echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
  162. diff --git a/config.rpath b/config.rpath
  163. index 4dea759..8c5684d 100755
  164. --- a/config.rpath
  165. +++ b/config.rpath
  166. @@ -6,6 +6,9 @@
  167. # Taken from GNU libtool, 2001
  168. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  169. #
  170. +# Modifications to support HyperbolaBSD:
  171. +# Copyright (C) 2020-2024 Hyperbola Project
  172. +#
  173. # This program is free software; you can redistribute it and/or modify
  174. # it under the terms of the GNU General Public License as published by
  175. # the Free Software Foundation; either version 2 of the License, or
  176. @@ -159,7 +162,7 @@ if test "$with_gnu_ld" = yes; then
  177. ld_shlibs=no
  178. fi
  179. ;;
  180. - netbsd*)
  181. + netbsd* | hyperbolabsd*)
  182. ;;
  183. solaris* | sysv5*)
  184. if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  185. @@ -358,6 +361,10 @@ else
  186. esac
  187. fi
  188. ;;
  189. + hyperbolabsd*)
  190. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  191. + hardcode_direct=yes
  192. + ;;
  193. os2*)
  194. hardcode_libdir_flag_spec='-L$libdir'
  195. hardcode_minus_L=yes
  196. @@ -489,6 +496,8 @@ case "$host_os" in
  197. ;;
  198. openbsd*)
  199. ;;
  200. + hyperbolabsd*)
  201. + ;;
  202. os2*)
  203. libname_spec='$name'
  204. shrext=.dll
  205. diff --git a/config.sub b/config.sub
  206. index f2632cd..0d91b14 100755
  207. --- a/config.sub
  208. +++ b/config.sub
  209. @@ -1,6 +1,9 @@
  210. #! /bin/sh
  211. # Configuration validation subroutine script.
  212. # Copyright 1992-2018 Free Software Foundation, Inc.
  213. +#
  214. +# Modifications to support HyperbolaBSD:
  215. +# Copyright (C) 2020-2024 Hyperbola Project
  216. timestamp='2018-01-01'
  217. @@ -1399,7 +1402,7 @@ case $os in
  218. | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  219. | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  220. | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
  221. - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
  222. + | -bitrig* | -openbsd* | -hyperbolabsd* | -solidbsd* | -libertybsd* \
  223. | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
  224. | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  225. | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  226. diff --git a/configure b/configure
  227. index 0601395..c0863d4 100755
  228. --- a/configure
  229. +++ b/configure
  230. @@ -6,6 +6,9 @@
  231. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  232. # Foundation, Inc.
  233. #
  234. +# Modifications to support HyperbolaBSD:
  235. +# Copyright (C) 2020-2024 Hyperbola Project
  236. +#
  237. # This configure script is free software; the Free Software Foundation
  238. # gives unlimited permission to copy, distribute and modify it.
  239. ## -------------------- ##
  240. @@ -2959,7 +2962,7 @@ case "${ENABLE_GOLD}" in
  241. case "${target}" in
  242. *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
  243. | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
  244. - | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
  245. + | *-*-netbsd* | *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly* \
  246. | *-*-solaris2* | *-*-nto* | *-*-nacl*)
  247. case "${target}" in
  248. *-*-linux*aout* | *-*-linux*oldld*)
  249. @@ -3154,7 +3157,7 @@ if test x$enable_libgomp = x ; then
  250. case "${target}" in
  251. *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
  252. ;;
  253. - *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
  254. + *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* | *-*-hyperbolabsd*)
  255. ;;
  256. *-*-solaris2* | *-*-hpux11*)
  257. ;;
  258. @@ -3568,6 +3571,9 @@ case "${target}" in
  259. *-*-netbsd*)
  260. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  261. ;;
  262. + *-*-hyperbolabsd*)
  263. + noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  264. + ;;
  265. *-*-netware*)
  266. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  267. ;;
  268. diff --git a/configure.ac b/configure.ac
  269. index c343333..b952544 100644
  270. --- a/configure.ac
  271. +++ b/configure.ac
  272. @@ -2,6 +2,9 @@
  273. # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
  274. # 2014, 2015, 2016 Free Software Foundation, Inc.
  275. #
  276. +# Modifications to support HyperbolaBSD:
  277. +# Copyright (C) 2020-2024 Hyperbola Project
  278. +#
  279. # This file is free software; you can redistribute it and/or modify it
  280. # under the terms of the GNU General Public License as published by
  281. # the Free Software Foundation; either version 3 of the License, or
  282. @@ -330,7 +333,7 @@ case "${ENABLE_GOLD}" in
  283. case "${target}" in
  284. *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
  285. | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
  286. - | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
  287. + | *-*-netbsd* | *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly* \
  288. | *-*-solaris2* | *-*-nto* | *-*-nacl*)
  289. case "${target}" in
  290. *-*-linux*aout* | *-*-linux*oldld*)
  291. @@ -506,7 +509,7 @@ if test x$enable_libgomp = x ; then
  292. case "${target}" in
  293. *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
  294. ;;
  295. - *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
  296. + *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* | *-*-hyperbolabsd*)
  297. ;;
  298. *-*-solaris2* | *-*-hpux11*)
  299. ;;
  300. @@ -899,6 +902,9 @@ case "${target}" in
  301. *-*-netbsd*)
  302. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  303. ;;
  304. + *-*-hyperbolabsd*)
  305. + noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  306. + ;;
  307. *-*-netware*)
  308. noconfigdirs="$noconfigdirs target-newlib target-libgloss"
  309. ;;
  310. diff --git a/contrib/config-list.mk b/contrib/config-list.mk
  311. index fee08b0..27ed619 100644
  312. --- a/contrib/config-list.mk
  313. +++ b/contrib/config-list.mk
  314. @@ -30,12 +30,14 @@ GCC_SRC_DIR=../../gcc
  315. #
  316. # v850e1-elf is rejected by config.sub
  317. -LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
  318. +LIST = aarch64-elf aarch64-linux-gnu aarch64-hyperbolabsd aarch64-rtems \
  319. alpha-linux-gnu alpha-freebsd6 alpha-netbsd alpha-openbsd \
  320. alpha64-dec-vms alpha-dec-vms \
  321. arc-elf32OPT-with-cpu=arc600 arc-elf32OPT-with-cpu=arc700 \
  322. arc-linux-uclibcOPT-with-cpu=arc700 arceb-linux-uclibcOPT-with-cpu=arc700 \
  323. arm-wrs-vxworks arm-netbsdelf \
  324. + armv7b-hyperbolabsdeabi armv7b-hyperbolabsdeabihf \
  325. + armv7l-hyperbolabsdeabi armv7l-hyperbolabsdeabihf \
  326. arm-linux-androideabi arm-uclinux_eabi arm-eabi arm-rtems \
  327. arm-symbianelf avr-elf \
  328. bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \
  329. @@ -48,7 +50,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
  330. i686-pc-linux-gnu i686-apple-darwin i686-apple-darwin9 i686-apple-darwin10 \
  331. i486-freebsd4 i686-freebsd6 i686-kfreebsd-gnu \
  332. i686-netbsdelf9 \
  333. - i686-openbsd i686-elf i686-kopensolaris-gnu i686-symbolics-gnu \
  334. + i686-openbsd i686-hyperbolabsd i686-elf i686-kopensolaris-gnu i686-symbolics-gnu \
  335. i686-pc-msdosdjgpp i686-lynxos i686-nto-qnx \
  336. i686-rtems i686-solaris2.10 i686-wrs-vxworks \
  337. i686-wrs-vxworksae \
  338. @@ -72,6 +74,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
  339. pdp11-aout \
  340. powerpc-darwin8 \
  341. powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \
  342. + powerpc-hyperbolabsd powerpc64-hyperbolabsd \
  343. powerpc-eabispe powerpc-eabisimaltivec powerpc-eabisim ppc-elf \
  344. powerpc-eabialtivec powerpc-xilinx-eabi powerpc-eabi \
  345. powerpc-rtems powerpc-linux_spe \
  346. @@ -79,7 +82,9 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
  347. powerpc-wrs-vxworks powerpc-wrs-vxworksae powerpc-wrs-vxworksmils \
  348. powerpc-lynxos powerpcle-elf \
  349. powerpcle-eabisim powerpcle-eabi \
  350. + powerpcle-hyperbolabsd powerpc64le-hyperbolabsd \
  351. riscv32-unknown-linux-gnu riscv64-unknown-linux-gnu \
  352. + riscv32-hyperbolabsd riscv64-hyperbolabsd \
  353. rs6000-ibm-aix5.3.0 rs6000-ibm-aix6.1 rs6000-ibm-aix7.1 \
  354. rl78-elf rx-elf s390-linux-gnu s390x-linux-gnu s390x-ibm-tpf sh-elf \
  355. shle-linux sh-netbsdelf sh-superh-elf \
  356. @@ -94,7 +99,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
  357. vax-netbsdelf vax-openbsd visium-elf x86_64-apple-darwin \
  358. x86_64-pc-linux-gnuOPT-with-fpmath=avx \
  359. x86_64-elfOPT-with-fpmath=sse x86_64-freebsd6 x86_64-netbsd \
  360. - x86_64-w64-mingw32 \
  361. + x86_64-hyperbolabsd x86_64-w64-mingw32 \
  362. x86_64-mingw32OPT-enable-sjlj-exceptions=yes x86_64-rtems \
  363. xstormy16-elf xtensa-elf \
  364. xtensa-linux
  365. diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
  366. index 9578c99..d60286b 100644
  367. --- a/fixincludes/fixincl.x
  368. +++ b/fixincludes/fixincl.x
  369. @@ -23,6 +23,9 @@
  370. * 2006, 2007, 2008
  371. * The Free Software Foundation, Inc.
  372. *
  373. + * Modifications to support HyperbolaBSD:
  374. + * Copyright (C) 2020-2024 Hyperbola Project
  375. + *
  376. * inclhack is free software: you can redistribute it and/or modify it
  377. * under the terms of the GNU General Public License as published by the
  378. * Free Software Foundation, either version 3 of the License, or
  379. @@ -6744,6 +6747,60 @@ static const char* apzOpenbsd_Null_DefinitionPatch[] = {
  380. ^#endif",
  381. (char*)NULL };
  382. +/* * * * * * * * * * * * * * * * * * * * * * * * * *
  383. + *
  384. + * Description of Hyperbolabsd_Null_Definition fix
  385. + */
  386. +tSCC zHyperbolabsd_Null_DefinitionName[] =
  387. + "hyperbolabsd_null_definition";
  388. +
  389. +/*
  390. + * File name selection pattern
  391. + */
  392. +tSCC zHyperbolabsd_Null_DefinitionList[] =
  393. + "locale.h\0stddef.h\0stdio.h\0string.h\0time.h\0unistd.h\0wchar.h\0sys/param.h\0";
  394. +/*
  395. + * Machine/OS name selection pattern
  396. + */
  397. +tSCC* apzHyperbolabsd_Null_DefinitionMachs[] = {
  398. + "*-*-hyperbolabsd*",
  399. + (const char*)NULL };
  400. +
  401. +/*
  402. + * content selection pattern - do fix if pattern found
  403. + */
  404. +tSCC zHyperbolabsd_Null_DefinitionSelect0[] =
  405. + "__GNUG__";
  406. +
  407. +#define HYPERBOLABSD_NULL_DEFINITION_TEST_CT 1
  408. +static tTestDesc aHyperbolabsd_Null_DefinitionTests[] = {
  409. + { TT_EGREP, zHyperbolabsd_Null_DefinitionSelect0, (regex_t*)NULL }, };
  410. +
  411. +/*
  412. + * Fix Command Arguments for Hyperbolabsd_Null_Definition
  413. + */
  414. +static const char* apzHyperbolabsd_Null_DefinitionPatch[] = {
  415. + "format",
  416. + "#ifndef NULL\n\
  417. +#ifdef __cplusplus\n\
  418. +#ifdef __GNUG__\n\
  419. +#define NULL\t__null\n\
  420. +#else\t /* ! __GNUG__ */\n\
  421. +#define NULL\t0L\n\
  422. +#endif\t /* __GNUG__ */\n\
  423. +#else\t /* ! __cplusplus */\n\
  424. +#define NULL\t((void *)0)\n\
  425. +#endif\t /* __cplusplus */\n\
  426. +#endif\t /* !NULL */",
  427. + "^#ifndef[ \t]*NULL\n\
  428. +^#ifdef[ \t]*__GNUG__\n\
  429. +^#define[ \t]*NULL[ \t]*__null\n\
  430. +^#else\n\
  431. +^#define[ \t]*NULL[ \t]*0L\n\
  432. +^#endif\n\
  433. +^#endif",
  434. + (char*)NULL };
  435. +
  436. /* * * * * * * * * * * * * * * * * * * * * * * * * *
  437. *
  438. * Description of Obstack_Lvalue_Cast fix
  439. @@ -6816,6 +6873,43 @@ static const char* apzOpenbsd_Va_StartPatch[] = {
  440. "__builtin_va_start",
  441. (char*)NULL };
  442. +/* * * * * * * * * * * * * * * * * * * * * * * * * *
  443. + *
  444. + * Description of Hyperbolabsd_Va_Start fix
  445. + */
  446. +tSCC zHyperbolabsd_Va_StartName[] =
  447. + "hyperbolabsd_va_start";
  448. +
  449. +/*
  450. + * File name selection pattern
  451. + */
  452. +tSCC zHyperbolabsd_Va_StartList[] =
  453. + "stdarg.h\0";
  454. +/*
  455. + * Machine/OS name selection pattern
  456. + */
  457. +tSCC* apzHyperbolabsd_Va_StartMachs[] = {
  458. + "*-*-hyperbolabsd*",
  459. + (const char*)NULL };
  460. +
  461. +/*
  462. + * content selection pattern - do fix if pattern found
  463. + */
  464. +tSCC zHyperbolabsd_Va_StartSelect0[] =
  465. + "__builtin_stdarg_start";
  466. +
  467. +#define HYPERBOLABSD_VA_START_TEST_CT 1
  468. +static tTestDesc aHyperbolabsd_Va_StartTests[] = {
  469. + { TT_EGREP, zHyperbolabsd_Va_StartSelect0, (regex_t*)NULL }, };
  470. +
  471. +/*
  472. + * Fix Command Arguments for Hyperbolabsd_Va_Start
  473. + */
  474. +static const char* apzHyperbolabsd_Va_StartPatch[] = {
  475. + "format",
  476. + "__builtin_va_start",
  477. + (char*)NULL };
  478. +
  479. /* * * * * * * * * * * * * * * * * * * * * * * * * *
  480. *
  481. * Description of Osf_Namespace_A fix
  482. @@ -10528,8 +10622,10 @@ typedef enum {
  483. NEXT_WAIT_UNION_FIXIDX,
  484. NODEENT_SYNTAX_FIXIDX,
  485. OPENBSD_NULL_DEFINITION_FIXIDX,
  486. + HYPERBOLABSD_NULL_DEFINITION_FIXIDX,
  487. OBSTACK_LVALUE_CAST_FIXIDX,
  488. OPENBSD_VA_START_FIXIDX,
  489. + HYPERBOLABSD_VA_START_FIXIDX,
  490. OSF_NAMESPACE_A_FIXIDX,
  491. OSF_NAMESPACE_C_FIXIDX,
  492. PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_FIXIDX,
  493. @@ -11442,6 +11538,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
  494. OPENBSD_NULL_DEFINITION_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
  495. aOpenbsd_Null_DefinitionTests, apzOpenbsd_Null_DefinitionPatch, 0 },
  496. + { zHyperbolabsd_Null_DefinitionName, zHyperbolabsd_Null_DefinitionList,
  497. + apzHyperbolabsd_Null_DefinitionMachs,
  498. + HYPERBOLABSD_NULL_DEFINITION_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
  499. + aHyperbolabsd_Null_DefinitionTests, apzHyperbolabsd_Null_DefinitionPatch, 0 },
  500. +
  501. { zObstack_Lvalue_CastName, zObstack_Lvalue_CastList,
  502. apzObstack_Lvalue_CastMachs,
  503. OBSTACK_LVALUE_CAST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
  504. @@ -11452,6 +11553,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
  505. OPENBSD_VA_START_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
  506. aOpenbsd_Va_StartTests, apzOpenbsd_Va_StartPatch, 0 },
  507. + { zHyperbolabsd_Va_StartName, zHyperbolabsd_Va_StartList,
  508. + apzHyperbolabsd_Va_StartMachs,
  509. + HYPERBOLABSD_VA_START_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
  510. + aHyperbolabsd_Va_StartTests, apzHyperbolabsd_Va_StartPatch, 0 },
  511. +
  512. { zOsf_Namespace_AName, zOsf_Namespace_AList,
  513. apzOsf_Namespace_AMachs,
  514. OSF_NAMESPACE_A_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
  515. diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
  516. index 948ea1d..cd4717a 100644
  517. --- a/fixincludes/inclhack.def
  518. +++ b/fixincludes/inclhack.def
  519. @@ -1008,8 +1008,8 @@ fix = {
  520. };
  521. /*
  522. - * Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
  523. - * And OpenBSD.
  524. + * Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0,
  525. + * OpenBSD and HyperbolaBSD.
  526. */
  527. fix = {
  528. hackname = alpha_sbrk;
  529. @@ -3394,6 +3394,45 @@ fix = {
  530. "#endif\n";
  531. };
  532. +/*
  533. + * Fix HyperbolaBSD's NULL definition.
  534. + */
  535. +fix = {
  536. + hackname = hyperbolabsd_null_definition;
  537. + mach = "*-*-hyperbolabsd*";
  538. + files = locale.h, stddef.h, stdio.h, string.h,
  539. + time.h, unistd.h, wchar.h, sys/param.h;
  540. + select = "__GNUG__";
  541. + c_fix = format;
  542. + c_fix_arg = "#ifndef NULL\n"
  543. + "#ifdef __cplusplus\n"
  544. + "#ifdef __GNUG__\n"
  545. + "#define NULL\t__null\n"
  546. + "#else\t /* ! __GNUG__ */\n"
  547. + "#define NULL\t0L\n"
  548. + "#endif\t /* __GNUG__ */\n"
  549. + "#else\t /* ! __cplusplus */\n"
  550. + "#define NULL\t((void *)0)\n"
  551. + "#endif\t /* __cplusplus */\n"
  552. + "#endif\t /* !NULL */";
  553. +
  554. + c_fix_arg = "^#ifndef[ \t]*NULL\n"
  555. + "^#ifdef[ \t]*__GNUG__\n"
  556. + "^#define[ \t]*NULL[ \t]*__null\n"
  557. + "^#else\n"
  558. + "^#define[ \t]*NULL[ \t]*0L\n"
  559. + "^#endif\n"
  560. + "^#endif";
  561. + test_text =
  562. + "#ifndef NULL\n"
  563. + "#ifdef __GNUG__\n"
  564. + "#define NULL __null\n"
  565. + "#else\n"
  566. + "#define NULL 0L\n"
  567. + "#endif\n"
  568. + "#endif\n";
  569. +};
  570. +
  571. /*
  572. * obstack.h used casts as lvalues.
  573. *
  574. @@ -3432,6 +3471,20 @@ fix = {
  575. test_text = "#define va_start(v,l) __builtin_stdarg_start((v),l)";
  576. };
  577. +/*
  578. + * Fix HyperbolaBSD's va_start define.
  579. + */
  580. +fix = {
  581. + hackname = hyperbolabsd_va_start;
  582. + mach = "*-*-hyperbolabsd*";
  583. + files = stdarg.h;
  584. + select = '__builtin_stdarg_start';
  585. + c_fix = format;
  586. + c_fix_arg = __builtin_va_start;
  587. +
  588. + test_text = "#define va_start(v,l) __builtin_stdarg_start((v),l)";
  589. +};
  590. +
  591. /*
  592. * sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
  593. * defining regex.h related types. This causes libg++ build and usage
  594. @@ -4366,7 +4419,7 @@ fix = {
  595. * IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr
  596. * in prototype without previous definition.
  597. *
  598. - * Don't fix OpenBSD, which uses struct sockaddr_in prototyping the same
  599. + * Don't fix OpenBSD and HyperbolaBSD, which uses struct sockaddr_in prototyping the same
  600. * function, and does define it.
  601. */
  602. fix = {
  603. diff --git a/fixincludes/tests/base/locale.h b/fixincludes/tests/base/locale.h
  604. index 7a7273e..a23224b 100644
  605. --- a/fixincludes/tests/base/locale.h
  606. +++ b/fixincludes/tests/base/locale.h
  607. @@ -9,7 +9,7 @@
  608. -#if defined( OPENBSD_NULL_DEFINITION_CHECK )
  609. +#if defined( OPENBSD_NULL_DEFINITION_CHECK ) || defined( HYPERBOLABSD_NULL_DEFINITION_CHECK )
  610. #ifndef NULL
  611. #ifdef __cplusplus
  612. #ifdef __GNUG__
  613. @@ -22,4 +22,4 @@
  614. #endif /* __cplusplus */
  615. #endif /* !NULL */
  616. -#endif /* OPENBSD_NULL_DEFINITION_CHECK */
  617. +#endif /* OPENBSD_NULL_DEFINITION_CHECK || HYPERBOLABSD_NULL_DEFINITION_CHECK */
  618. diff --git a/fixincludes/tests/base/stdarg.h b/fixincludes/tests/base/stdarg.h
  619. index 686d0b3..aabd92e 100644
  620. --- a/fixincludes/tests/base/stdarg.h
  621. +++ b/fixincludes/tests/base/stdarg.h
  622. @@ -9,6 +9,6 @@
  623. -#if defined( OPENBSD_VA_START_CHECK )
  624. +#if defined( OPENBSD_VA_START_CHECK ) || defined( HYPERBOLABSD_VA_START_CHECK )
  625. #define va_start(v,l) __builtin_va_start((v),l)
  626. -#endif /* OPENBSD_VA_START_CHECK */
  627. +#endif /* OPENBSD_VA_START_CHECK || HYPERBOLABSD_VA_START_CHECK */
  628. diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
  629. index 4143465..21de10a 100644
  630. --- a/gcc/ada/adaint.c
  631. +++ b/gcc/ada/adaint.c
  632. @@ -8,6 +8,9 @@
  633. * *
  634. * Copyright (C) 1992-2018, Free Software Foundation, Inc. *
  635. * *
  636. + * Modifications to support HyperbolaBSD: *
  637. + * Copyright (C) 2020-2024 Hyperbola Project *
  638. + * *
  639. * GNAT is free software; you can redistribute it and/or modify it under *
  640. * terms of the GNU General Public License as published by the Free Soft- *
  641. * ware Foundation; either version 3, or (at your option) any later ver- *
  642. @@ -1014,7 +1017,8 @@ __gnat_open_new_temp (char *path, int fmode)
  643. strcpy (path, "GNAT-XXXXXX");
  644. -#if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
  645. +#if (defined (__FreeBSD__) || defined (__NetBSD__) \
  646. + || defined (__OpenBSD__) || defined (__HyperbolaBSD__) \
  647. || defined (__linux__) || defined (__GLIBC__) || defined (__ANDROID__) \
  648. || defined (__DragonFly__) || defined (__QNX__)) && !defined (__vxworks)
  649. return mkstemp (path);
  650. @@ -1188,7 +1192,8 @@ __gnat_tmp_name (char *tmp_filename)
  651. }
  652. #elif defined (__linux__) || defined (__FreeBSD__) || defined (__NetBSD__) \
  653. - || defined (__OpenBSD__) || defined (__GLIBC__) || defined (__ANDROID__) \
  654. + || defined (__OpenBSD__) || defined (__HyperbolaBSD__) \
  655. + || defined (__GLIBC__) || defined (__ANDROID__) \
  656. || defined (__DragonFly__) || defined (__QNX__)
  657. #define MAX_SAFE_PATH 1000
  658. char *tmpdir = getenv ("TMPDIR");
  659. @@ -2349,7 +2354,8 @@ __gnat_number_of_cpus (void)
  660. int cores = 1;
  661. #if defined (__linux__) || defined (__sun__) || defined (_AIX) \
  662. - || defined (__APPLE__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
  663. + || defined (__APPLE__) || defined (__FreeBSD__) \
  664. + || defined (__OpenBSD__) || defined (__HyperbolaBSD__) \
  665. || defined (__DragonFly__) || defined (__NetBSD__) || defined (__QNX__)
  666. cores = (int) sysconf (_SC_NPROCESSORS_ONLN);
  667. diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
  668. index cdcb531..0ee99b3 100644
  669. --- a/gcc/ada/cstreams.c
  670. +++ b/gcc/ada/cstreams.c
  671. @@ -8,6 +8,9 @@
  672. * *
  673. * Copyright (C) 1992-2018, Free Software Foundation, Inc. *
  674. * *
  675. + * Modifications to support HyperbolaBSD: *
  676. + * Copyright (C) 2024 Hyperbola Project *
  677. + * *
  678. * GNAT is free software; you can redistribute it and/or modify it under *
  679. * terms of the GNU General Public License as published by the Free Soft- *
  680. * ware Foundation; either version 3, or (at your option) any later ver- *
  681. @@ -190,7 +193,8 @@ __gnat_full_name (char *nam, char *buffer)
  682. *p = '\\';
  683. }
  684. -#elif defined (__FreeBSD__) || defined (__DragonFly__) || defined (__OpenBSD__)
  685. +#elif defined (__FreeBSD__) || defined (__DragonFly__) || defined (__OpenBSD__) \
  686. + || defined (__HyperbolaBSD__)
  687. /* Use realpath function which resolves links and references to . and ..
  688. on those Unix systems that support it. Note that GNU/Linux provides it but
  689. diff --git a/gcc/ada/env.c b/gcc/ada/env.c
  690. index b6ab097..7e9357c 100644
  691. --- a/gcc/ada/env.c
  692. +++ b/gcc/ada/env.c
  693. @@ -8,6 +8,9 @@
  694. * *
  695. * Copyright (C) 2005-2018, Free Software Foundation, Inc. *
  696. * *
  697. + * Modifications to support HyperbolaBSD: *
  698. + * Copyright (C) 2020-2024 Hyperbola Project *
  699. + * *
  700. * GNAT is free software; you can redistribute it and/or modify it under *
  701. * terms of the GNU General Public License as published by the Free Soft- *
  702. * ware Foundation; either version 3, or (at your option) any later ver- *
  703. @@ -301,8 +304,8 @@ void __gnat_clearenv (void)
  704. }
  705. #elif defined (__MINGW32__) || defined (__FreeBSD__) || defined (__APPLE__) \
  706. || (defined (__vxworks) && defined (__RTP__)) || defined (__CYGWIN__) \
  707. - || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__rtems__) \
  708. - || defined (__DragonFly__) || defined (__DJGPP__)
  709. + || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__HyperbolaBSD__) \
  710. + || defined (__rtems__) || defined (__DragonFly__) || defined (__DJGPP__)
  711. /* On Windows, FreeBSD and MacOS there is no function to clean all the
  712. environment but there is a "clean" way to unset a variable. So go
  713. through the environ table and call __gnat_unsetenv on all entries */
  714. diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h
  715. index 8b85854..4fcf150 100644
  716. --- a/gcc/ada/gsocket.h
  717. +++ b/gcc/ada/gsocket.h
  718. @@ -8,6 +8,9 @@
  719. * *
  720. * Copyright (C) 2004-2018, Free Software Foundation, Inc. *
  721. * *
  722. + * Modifications to support HyperbolaBSD: *
  723. + * Copyright (C) 2020-2024 Hyperbola Project *
  724. + * *
  725. * GNAT is free software; you can redistribute it and/or modify it under *
  726. * terms of the GNU General Public License as published by the Free Soft- *
  727. * ware Foundation; either version 3, or (at your option) any later ver- *
  728. @@ -211,7 +214,8 @@
  729. #if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || \
  730. defined (_WIN32) || defined (__APPLE__) || defined (__ANDROID__) || \
  731. - defined (__DragonFly__) || defined (__NetBSD__) || defined (__OpenBSD__)
  732. + defined (__DragonFly__) || defined (__NetBSD__) || defined (__OpenBSD__) || \
  733. + defined (__HyperbolaBSD__)
  734. # define HAVE_THREAD_SAFE_GETxxxBYyyy 1
  735. #elif defined (__linux__) || defined (__GLIBC__) || \
  736. @@ -244,7 +248,8 @@
  737. #endif
  738. #if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__) \
  739. - || defined (__DragonFly__) || defined (__NetBSD__) || defined (__OpenBSD__)
  740. + || defined (__DragonFly__) || defined (__NetBSD__) || defined (__OpenBSD__) \
  741. + || defined (__HyperbolaBSD__)
  742. # define Has_Sockaddr_Len 1
  743. #else
  744. # define Has_Sockaddr_Len 0
  745. diff --git a/gcc/ada/init.c b/gcc/ada/init.c
  746. index 5088ecf..7632726 100644
  747. --- a/gcc/ada/init.c
  748. +++ b/gcc/ada/init.c
  749. @@ -8,6 +8,9 @@
  750. * *
  751. * Copyright (C) 1992-2018, Free Software Foundation, Inc. *
  752. * *
  753. + * Modifications to support HyperbolaBSD: *
  754. + * Copyright (C) 2020-2024 Hyperbola Project *
  755. + * *
  756. * GNAT is free software; you can redistribute it and/or modify it under *
  757. * terms of the GNU General Public License as published by the Free Soft- *
  758. * ware Foundation; either version 3, or (at your option) any later ver- *
  759. @@ -2297,6 +2300,69 @@ __gnat_install_handler (void)
  760. __gnat_handler_installed = 1;
  761. }
  762. +/************************/
  763. +/* HyperbolaBSD Section */
  764. +/************************/
  765. +
  766. +#elif defined(__HyperbolaBSD__)
  767. +
  768. +#include <signal.h>
  769. +#include <unistd.h>
  770. +
  771. +static void
  772. +__gnat_error_handler (int sig)
  773. +{
  774. + struct Exception_Data *exception;
  775. + const char *msg;
  776. +
  777. + switch(sig)
  778. + {
  779. + case SIGFPE:
  780. + exception = &constraint_error;
  781. + msg = "SIGFPE";
  782. + break;
  783. + case SIGILL:
  784. + exception = &constraint_error;
  785. + msg = "SIGILL";
  786. + break;
  787. + case SIGSEGV:
  788. + exception = &storage_error;
  789. + msg = "stack overflow or erroneous memory access";
  790. + break;
  791. + case SIGBUS:
  792. + exception = &constraint_error;
  793. + msg = "SIGBUS";
  794. + break;
  795. + default:
  796. + exception = &program_error;
  797. + msg = "unhandled signal";
  798. + }
  799. +
  800. + Raise_From_Signal_Handler (exception, msg);
  801. +}
  802. +
  803. +void
  804. +__gnat_install_handler (void)
  805. +{
  806. + struct sigaction act;
  807. +
  808. + act.sa_handler = __gnat_error_handler;
  809. + act.sa_flags = SA_NODEFER | SA_RESTART;
  810. + sigemptyset (&act.sa_mask);
  811. +
  812. + /* Do not install handlers if interrupt state is "System" */
  813. + if (__gnat_get_interrupt_state (SIGFPE) != 's')
  814. + sigaction (SIGFPE, &act, NULL);
  815. + if (__gnat_get_interrupt_state (SIGILL) != 's')
  816. + sigaction (SIGILL, &act, NULL);
  817. + if (__gnat_get_interrupt_state (SIGSEGV) != 's')
  818. + sigaction (SIGSEGV, &act, NULL);
  819. + if (__gnat_get_interrupt_state (SIGBUS) != 's')
  820. + sigaction (SIGBUS, &act, NULL);
  821. +
  822. + __gnat_handler_installed = 1;
  823. +}
  824. +
  825. /******************/
  826. /* Darwin Section */
  827. /******************/
  828. @@ -2750,7 +2816,8 @@ __gnat_install_handler (void)
  829. #if defined (_WIN32) || defined (__INTERIX) \
  830. || defined (__Lynx__) || defined(__NetBSD__) || defined(__FreeBSD__) \
  831. - || defined (__OpenBSD__) || defined (__DragonFly__) || defined(__QNX__)
  832. + || defined (__OpenBSD__) || defined(__HyperbolaBSD__) \
  833. + || defined (__DragonFly__) || defined(__QNX__)
  834. #define HAVE_GNAT_INIT_FLOAT
  835. diff --git a/gcc/ada/initialize.c b/gcc/ada/initialize.c
  836. index d3f495c..a8bc662 100644
  837. --- a/gcc/ada/initialize.c
  838. +++ b/gcc/ada/initialize.c
  839. @@ -8,6 +8,9 @@
  840. * *
  841. * Copyright (C) 1992-2018, Free Software Foundation, Inc. *
  842. * *
  843. + * Modifications to support HyperbolaBSD: *
  844. + * Copyright (C) 2020-2024 Hyperbola Project *
  845. + * *
  846. * GNAT is free software; you can redistribute it and/or modify it under *
  847. * terms of the GNU General Public License as published by the Free Soft- *
  848. * ware Foundation; either version 3, or (at your option) any later ver- *
  849. @@ -86,7 +89,7 @@ __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
  850. /******************************************/
  851. #elif defined (__Lynx__) || defined (__FreeBSD__) || defined(__NetBSD__) \
  852. - || defined (__OpenBSD__) || defined (__DragonFly__)
  853. + || defined (__OpenBSD__) || defined (__HyperbolaBSD__) || defined (__DragonFly__)
  854. void
  855. __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
  856. diff --git a/gcc/ada/link.c b/gcc/ada/link.c
  857. index 84dff73..357d9cf 100644
  858. --- a/gcc/ada/link.c
  859. +++ b/gcc/ada/link.c
  860. @@ -8,6 +8,9 @@
  861. * *
  862. * Copyright (C) 1992-2018, Free Software Foundation, Inc. *
  863. * *
  864. + * Modifications to support HyperbolaBSD: *
  865. + * Copyright (C) 2020-2024 Hyperbola Project *
  866. + * *
  867. * GNAT is free software; you can redistribute it and/or modify it under *
  868. * terms of the GNU General Public License as published by the Free Soft- *
  869. * ware Foundation; either version 3, or (at your option) any later ver- *
  870. @@ -105,7 +108,7 @@ const char *__gnat_default_libgcc_subdir = "lib";
  871. #elif defined (__FreeBSD__) || defined (__DragonFly__) \
  872. || defined (__NetBSD__) || defined (__OpenBSD__) \
  873. - || defined (__QNX__)
  874. + || defined (__HyperbolaBSD__) || defined (__QNX__)
  875. const char *__gnat_object_file_option = "-Wl,@";
  876. const char *__gnat_run_path_option = "-Wl,-rpath,";
  877. char __gnat_shared_libgnat_default = STATIC;
  878. diff --git a/gcc/ada/rtinit.c b/gcc/ada/rtinit.c
  879. index 1aa1dc9..bef1798 100644
  880. --- a/gcc/ada/rtinit.c
  881. +++ b/gcc/ada/rtinit.c
  882. @@ -8,6 +8,9 @@
  883. * *
  884. * Copyright (C) 2014-2018, Free Software Foundation, Inc. *
  885. * *
  886. + * Modifications to support HyperbolaBSD: *
  887. + * Copyright (C) 2020-2024 Hyperbola Project *
  888. + * *
  889. * GNAT is free software; you can redistribute it and/or modify it under *
  890. * terms of the GNU General Public License as published by the Free Soft- *
  891. * ware Foundation; either version 3, or (at your option) any later ver- *
  892. @@ -314,7 +317,7 @@ __gnat_runtime_initialize(int install_handler)
  893. /**************************************************/
  894. #elif defined (__Lynx__) || defined (__FreeBSD__) || defined(__NetBSD__) \
  895. - || defined (__OpenBSD__)
  896. + || defined (__OpenBSD__) || defined (__HyperbolaBSD__)
  897. extern void __gnat_init_float (void);
  898. diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
  899. index 2de38a9..7066dca 100644
  900. --- a/gcc/ada/socket.c
  901. +++ b/gcc/ada/socket.c
  902. @@ -8,6 +8,9 @@
  903. * *
  904. * Copyright (C) 2003-2018, Free Software Foundation, Inc. *
  905. * *
  906. + * Modifications to support HyperbolaBSD: *
  907. + * Copyright (C) 2020-2024 Hyperbola Project *
  908. + * *
  909. * GNAT is free software; you can redistribute it and/or modify it under *
  910. * terms of the GNU General Public License as published by the Free Soft- *
  911. * ware Foundation; either version 3, or (at your option) any later ver- *
  912. @@ -38,7 +41,7 @@
  913. #include "gsocket.h"
  914. #if defined (__FreeBSD__) || defined (__DragonFly__) \
  915. - || defined (__NetBSD__) || defined (__OpenBSD__)
  916. + || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__HyperbolaBSD__)
  917. typedef unsigned int IOCTL_Req_T;
  918. #else
  919. typedef int IOCTL_Req_T;
  920. diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
  921. index 98b3901..ab4c90c 100644
  922. --- a/gcc/ada/sysdep.c
  923. +++ b/gcc/ada/sysdep.c
  924. @@ -8,6 +8,9 @@
  925. * *
  926. * Copyright (C) 1992-2018, Free Software Foundation, Inc. *
  927. * *
  928. + * Modifications to support HyperbolaBSD: *
  929. + * Copyright (C) 2024 Hyperbola Project *
  930. + * *
  931. * GNAT is free software; you can redistribute it and/or modify it under *
  932. * terms of the GNU General Public License as published by the Free Soft- *
  933. * ware Foundation; either version 3, or (at your option) any later ver- *
  934. @@ -317,6 +320,7 @@ __gnat_ttyname (int filedes)
  935. || defined (__MACHTEN__) || defined (__hpux__) || defined (_AIX) \
  936. || (defined (__svr4__) && defined (__i386__)) || defined (__Lynx__) \
  937. || defined (__CYGWIN__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
  938. + || defined (__HyperbolaBSD__) \
  939. || defined (__GLIBC__) || defined (__APPLE__) || defined (__DragonFly__) \
  940. || defined (__QNX__)
  941. @@ -370,6 +374,7 @@ getc_immediate_common (FILE *stream,
  942. || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \
  943. || defined (_AIX) || (defined (__svr4__) && defined (__i386__)) \
  944. || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
  945. + || defined (__HyperbolaBSD__) \
  946. || defined (__GLIBC__) || defined (__APPLE__) || defined (__DragonFly__) \
  947. || defined (__QNX__)
  948. char c;
  949. @@ -391,6 +396,7 @@ getc_immediate_common (FILE *stream,
  950. || defined (__MACHTEN__) || defined (__hpux__) \
  951. || defined (_AIX) || (defined (__svr4__) && defined (__i386__)) \
  952. || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
  953. + || defined (__HyperbolaBSD__) \
  954. || defined (__GLIBC__) || defined (__APPLE__) || defined (__DragonFly__) \
  955. || defined (__QNX__)
  956. eof_ch = termios_rec.c_cc[VEOF];
  957. @@ -829,6 +835,7 @@ __gnat_localtime_tzoff (const time_t *timer ATTRIBUTE_UNUSED,
  958. #elif defined (__APPLE__) || defined (__FreeBSD__) || defined (__linux__) \
  959. || defined (__GLIBC__) || defined (__DragonFly__) || defined (__OpenBSD__) \
  960. + || defined (__HyperbolaBSD__) \
  961. || defined (__DJGPP__) || defined (__QNX__)
  962. {
  963. localtime_r (timer, &tp);
  964. diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
  965. index 7025f57..7ae2fed 100644
  966. --- a/gcc/ada/terminals.c
  967. +++ b/gcc/ada/terminals.c
  968. @@ -8,6 +8,9 @@
  969. * *
  970. * Copyright (C) 2008-2018, AdaCore *
  971. * *
  972. + * Modifications to support HyperbolaBSD: *
  973. + * Copyright (C) 2020-2024 Hyperbola Project *
  974. + * *
  975. * GNAT is free software; you can redistribute it and/or modify it under *
  976. * terms of the GNU General Public License as published by the Free Soft- *
  977. * ware Foundation; either version 3, or (at your option) any later ver- *
  978. @@ -1096,6 +1099,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
  979. /* First defined some macro to identify easily some systems */
  980. #if defined (__FreeBSD__) \
  981. + || defined (__HyperbolaBSD__) \
  982. || defined (__OpenBSD__) \
  983. || defined (__NetBSD__) \
  984. || defined (__DragonFly__)
  985. diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c
  986. index fe63bc3..57ac493 100644
  987. --- a/gcc/ada/tracebak.c
  988. +++ b/gcc/ada/tracebak.c
  989. @@ -8,6 +8,9 @@
  990. * *
  991. * Copyright (C) 2000-2018, Free Software Foundation, Inc. *
  992. * *
  993. + * Modifications to support HyperbolaBSD: *
  994. + * Copyright (C) 2020-2024 Hyperbola Project *
  995. + * *
  996. * GNAT is free software; you can redistribute it and/or modify it under *
  997. * terms of the GNU General Public License as published by the Free Soft- *
  998. * ware Foundation; either version 3, or (at your option) any later ver- *
  999. @@ -289,7 +292,8 @@ __gnat_backtrace (void **array,
  1000. /*---------------------------- x86 *BSD --------------------------------*/
  1001. #elif defined (__i386__) && \
  1002. - ( defined (__NetBSD__) || defined (__FreeBSD__) || defined (__OpenBSD__) )
  1003. + ( defined (__NetBSD__) || defined (__FreeBSD__) \
  1004. + || defined (__OpenBSD__) || defined (__HyperbolaBSD__) )
  1005. #define USE_GCC_UNWINDER
  1006. /* The generic unwinder is not used for this target because the default
  1007. diff --git b/gcc/config/arm/hyperbolabsd.h b/gcc/config/arm/hyperbolabsd.h
  1008. new file mode 100644
  1009. index 0000000..f7b9059
  1010. --- /dev/null
  1011. +++ b/gcc/config/arm/hyperbolabsd.h
  1012. @@ -0,0 +1,214 @@
  1013. +/* Definitions of target machine for GNU compiler, HyperbolaBSD ARM ELF version.
  1014. + Copyright (C) 2002 Free Software Foundation, Inc.
  1015. + Contributed by Wasabi Systems, Inc.
  1016. +
  1017. + Modifications to support HyperbolaBSD:
  1018. + Copyright (C) 2020-2024 Hyperbola Project
  1019. +
  1020. +This file is part of GNU CC.
  1021. +
  1022. +GNU CC is free software; you can redistribute it and/or modify
  1023. +it under the terms of the GNU General Public License as published by
  1024. +the Free Software Foundation; either version 2, or (at your option)
  1025. +any later version.
  1026. +
  1027. +GNU CC is distributed in the hope that it will be useful,
  1028. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  1029. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1030. +GNU General Public License for more details.
  1031. +
  1032. +You should have received a copy of the GNU General Public License
  1033. +along with GNU CC; see the file COPYING. If not, write to
  1034. +the Free Software Foundation, 59 Temple Place - Suite 330,
  1035. +Boston, MA 02111-1307, USA. */
  1036. +
  1037. +/* This is used in ASM_FILE_START. */
  1038. +#undef ARM_OS_NAME
  1039. +#define ARM_OS_NAME "HyperbolaBSD"
  1040. +
  1041. +/* Unsigned chars produces much better code than signed. */
  1042. +#define DEFAULT_SIGNED_CHAR 0
  1043. +
  1044. +
  1045. +/* This defaults us to little-endian. */
  1046. +#ifndef TARGET_ENDIAN_DEFAULT
  1047. +#define TARGET_ENDIAN_DEFAULT 0
  1048. +#endif
  1049. +
  1050. +#undef MULTILIB_DEFAULTS
  1051. +
  1052. +/* armv6k default cpu. */
  1053. +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_mpcore
  1054. +
  1055. +/* We default to a soft-float ABI so that binaries can run on all
  1056. + target hardware. */
  1057. +#undef TARGET_DEFAULT_FLOAT_ABI
  1058. +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
  1059. +
  1060. +/* We default to the "aapcs-linux" ABI so that enums are int-sized by
  1061. + default. */
  1062. +#undef ARM_DEFAULT_ABI
  1063. +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
  1064. +
  1065. +#define TARGET_OS_CPP_BUILTINS() \
  1066. + do \
  1067. + { \
  1068. + builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
  1069. + HYPERBOLABSD_OS_CPP_BUILTINS_ELF(); \
  1070. + } \
  1071. + while (0)
  1072. +
  1073. +#undef SUBTARGET_CPP_SPEC
  1074. +#define SUBTARGET_CPP_SPEC HBBSD_CPP_SPEC
  1075. +
  1076. +/* HBBSD_LINK_SPEC appropriate for HyperbolaBSD. Support for GCC options
  1077. + -static, -assert, and -nostdlib. */
  1078. +#undef HBBSD_LINK_SPEC
  1079. +#ifdef HBBSD_NO_DYNAMIC_LIBRARIES
  1080. +#define HBBSD_LINK_SPEC \
  1081. + "%{!nostdlib:%{!r*:%{!e*:-e __start}}} %{assert*}"
  1082. +#else
  1083. +#define HBBSD_LINK_SPEC \
  1084. + "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
  1085. + %{shared:-shared} %{R*} \
  1086. + %{static:-Bstatic} \
  1087. + %{!static:-Bdynamic} \
  1088. + %{rdynamic:-export-dynamic} \
  1089. + %{assert*} \
  1090. + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
  1091. + %{!nostdlib:-L/lib -L/usr/lib}"
  1092. +#endif
  1093. +
  1094. +#undef SUBTARGET_EXTRA_ASM_SPEC
  1095. +#define SUBTARGET_EXTRA_ASM_SPEC \
  1096. + "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4} %{fpic|fPIC|fpie|fPIE:-k}"
  1097. +
  1098. +/* Default floating point model is soft-VFP.
  1099. + FIXME: -mhard-float currently implies FPA. */
  1100. +#undef SUBTARGET_ASM_FLOAT_SPEC
  1101. +#define SUBTARGET_ASM_FLOAT_SPEC \
  1102. + "%{mhard-float:-mfpu=fpa} \
  1103. + %{msoft-float:-mfpu=softvfp} \
  1104. + %{!mhard-float: \
  1105. + %{!msoft-float:-mfpu=softvfp}}"
  1106. +
  1107. +#undef SUBTARGET_EXTRA_SPECS
  1108. +#define SUBTARGET_EXTRA_SPECS \
  1109. + { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
  1110. + { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
  1111. + { "hyperbolabsd_link_spec", HBBSD_LINK_SPEC }, \
  1112. + { "hyperbolabsd_entry_point", HYPERBOLABSD_ENTRY_POINT },
  1113. +
  1114. +#define HYPERBOLABSD_ENTRY_POINT "__start"
  1115. +
  1116. +/* Pass -X to the linker so that it will strip symbols starting with 'L' */
  1117. +#undef LINK_SPEC
  1118. +#define LINK_SPEC \
  1119. + "-X %{mbig-endian:-EB} %{mlittle-endian:-EL} \
  1120. + %(hyperbolabsd_link_spec)"
  1121. +
  1122. +/* Make GCC agree with <machine/_types.h>. */
  1123. +
  1124. +#undef SIZE_TYPE
  1125. +#define SIZE_TYPE "long unsigned int"
  1126. +
  1127. +#undef PTRDIFF_TYPE
  1128. +#define PTRDIFF_TYPE "long int"
  1129. +
  1130. +#undef INTMAX_TYPE
  1131. +#define INTMAX_TYPE "long long int"
  1132. +
  1133. +#undef UINTMAX_TYPE
  1134. +#define UINTMAX_TYPE "long long unsigned int"
  1135. +
  1136. +#undef WCHAR_TYPE
  1137. +#define WCHAR_TYPE "int"
  1138. +
  1139. +#undef WCHAR_TYPE_SIZE
  1140. +#define WCHAR_TYPE_SIZE 32
  1141. +
  1142. +/* We don't have any limit on the length as out debugger is GDB. */
  1143. +#undef DBX_CONTIN_LENGTH
  1144. +
  1145. +/* HyperbolaBSD and NetBSD do their profiling differently to the Acorn compiler. We
  1146. + don't need a word following the mcount call; and to skip it
  1147. + requires either an assembly stub or use of fomit-frame-pointer when
  1148. + compiling the profiling functions. Since we break Acorn CC
  1149. + compatibility below a little more won't hurt. */
  1150. +
  1151. +#undef ARM_FUNCTION_PROFILER
  1152. +#define ARM_FUNCTION_PROFILER(STREAM,LABELNO) \
  1153. +{ \
  1154. + asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n"); \
  1155. + asm_fprintf (STREAM, "\tbl\t__mcount%s\n", \
  1156. + NEED_PLT_RELOC ? "(PLT)" : ""); \
  1157. +}
  1158. +
  1159. +/* On the ARM `@' introduces a comment, so we must use something else
  1160. + for .type directives. */
  1161. +#undef TYPE_OPERAND_FMT
  1162. +#define TYPE_OPERAND_FMT "%%%s"
  1163. +
  1164. +#undef FPUTYPE_DEFAULT
  1165. +#define FPUTYPE_DEFAULT FPUTYPE_VFP
  1166. +
  1167. +/* VERY BIG NOTE: Change of structure alignment for HyperbolaBSD|NetBSD ARM.
  1168. + There are consequences you should be aware of...
  1169. +
  1170. + Normally GCC/arm uses a structure alignment of 32 for compatibility
  1171. + with armcc. This means that structures are padded to a word
  1172. + boundary. However this causes problems with bugged HyperbolaBSD|NetBSD kernel
  1173. + code (possibly userland code as well - I have not checked every
  1174. + binary). The nature of this bugged code is to rely on sizeof()
  1175. + returning the correct size of various structures rounded to the
  1176. + nearest byte (SCSI and ether code are two examples, the vm system
  1177. + is another). This code breaks when the structure alignment is 32
  1178. + as sizeof() will report a word=rounded size. By changing the
  1179. + structure alignment to 8. GCC will conform to what is expected by
  1180. + HyperbolaBSD|NetBSD.
  1181. +
  1182. + This has several side effects that should be considered.
  1183. + 1. Structures will only be aligned to the size of the largest member.
  1184. + i.e. structures containing only bytes will be byte aligned.
  1185. + structures containing shorts will be half word alinged.
  1186. + structures containing ints will be word aligned.
  1187. +
  1188. + This means structures should be padded to a word boundary if
  1189. + alignment of 32 is required for byte structures etc.
  1190. +
  1191. + 2. A potential performance penalty may exist if strings are no longer
  1192. + word aligned. GCC will not be able to use word load/stores to copy
  1193. + short strings.
  1194. +
  1195. + This modification is not encouraged but with the present state of the
  1196. + HyperbolaBSD|NetBSD source tree it is currently the only solution that meets the
  1197. + requirements. */
  1198. +
  1199. +#undef DEFAULT_STRUCTURE_SIZE_BOUNDARY
  1200. +#define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8
  1201. +
  1202. +/* Clear the instruction cache from `BEG' to `END'. This makes a
  1203. + call to the ARM_SYNC_ICACHE architecture specific syscall. */
  1204. +#define CLEAR_INSN_CACHE(BEG, END) \
  1205. +do \
  1206. + { \
  1207. + extern int sysarch(int number, void *args); \
  1208. + struct { \
  1209. + unsigned int addr; \
  1210. + int len; \
  1211. + } s; \
  1212. + s.addr = (unsigned int)(BEG); \
  1213. + s.len = (END) - (BEG); \
  1214. + (void) sysarch (0, &s); \
  1215. + } \
  1216. +while (0)
  1217. +
  1218. +/* As an elf system, we need crtbegin/crtend stuff. */
  1219. +#undef STARTFILE_SPEC
  1220. +#define STARTFILE_SPEC "\
  1221. + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
  1222. + %{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \
  1223. + %{!nopie:rcrt0%O%s}}}} \
  1224. + crtbegin%O%s} %{shared:crtbeginS%O%s}"
  1225. +#undef ENDFILE_SPEC
  1226. +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
  1227. diff --git b/gcc/config/arm/hyperbolabsd_bpabi.h b/gcc/config/arm/hyperbolabsd_bpabi.h
  1228. new file mode 100644
  1229. index 0000000..3e85fa1
  1230. --- /dev/null
  1231. +++ b/gcc/config/arm/hyperbolabsd_bpabi.h
  1232. @@ -0,0 +1,64 @@
  1233. +/* Definitions of target machine for GNU compiler, HyperbolaBSD ARM ELF version.
  1234. + Copyright (C) 2002 Free Software Foundation, Inc.
  1235. + Contributed by Wasabi Systems, Inc.
  1236. +
  1237. + Modifications to support HyperbolaBSD:
  1238. + Copyright (C) 2024 Hyperbola Project
  1239. +
  1240. +This file is part of GNU CC.
  1241. +
  1242. +GNU CC is free software; you can redistribute it and/or modify
  1243. +it under the terms of the GNU General Public License as published by
  1244. +the Free Software Foundation; either version 2, or (at your option)
  1245. +any later version.
  1246. +
  1247. +GNU CC is distributed in the hope that it will be useful,
  1248. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  1249. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1250. +GNU General Public License for more details.
  1251. +
  1252. +You should have received a copy of the GNU General Public License
  1253. +along with GNU CC; see the file COPYING. If not, write to
  1254. +the Free Software Foundation, 59 Temple Place - Suite 330,
  1255. +Boston, MA 02111-1307, USA. */
  1256. +
  1257. +#define HBBSD_HAS_DECLARE_FUNCTION_NAME
  1258. +#define HBBSD_HAS_DECLARE_FUNCTION_SIZE
  1259. +
  1260. +/* use EABI frame unwinding tables. */
  1261. +#define TARGET_UNWIND_INFO 1
  1262. +
  1263. +#if defined (__thumb__)
  1264. +#define RENAME_LIBRARY_SET ".thumb_set"
  1265. +#else
  1266. +#define RENAME_LIBRARY_SET ".set"
  1267. +#endif
  1268. +
  1269. +/* Make __aeabi_AEABI_NAME an alias for __GCC_NAME. */
  1270. +#define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) \
  1271. + __asm__ (".globl\t__aeabi_" #AEABI_NAME "\n" \
  1272. + RENAME_LIBRARY_SET "\t__aeabi_" #AEABI_NAME \
  1273. + ", __" #GCC_NAME "\n");
  1274. +
  1275. +/* Give some libgcc functions an additional __aeabi name. */
  1276. +#ifdef L_muldi3
  1277. +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
  1278. +#endif
  1279. +#ifdef L_fixdfdi
  1280. +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz)
  1281. +#endif
  1282. +#ifdef L_fixunsdfdi
  1283. +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz)
  1284. +#endif
  1285. +#ifdef L_fixsfdi
  1286. +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz)
  1287. +#endif
  1288. +#ifdef L_fixunssfdi
  1289. +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz)
  1290. +#endif
  1291. +#ifdef L_floatdidf
  1292. +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d)
  1293. +#endif
  1294. +#ifdef L_floatdisf
  1295. +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
  1296. +#endif
  1297. diff --git b/gcc/config/host-hyperbolabsd.c b/gcc/config/host-hyperbolabsd.c
  1298. new file mode 100644
  1299. index 0000000..54844a6
  1300. --- /dev/null
  1301. +++ b/gcc/config/host-hyperbolabsd.c
  1302. @@ -0,0 +1,86 @@
  1303. +/* HyperbolaBSD host-specific hook definitions.
  1304. + Copyright (C) 2004-2018 Free Software Foundation, Inc.
  1305. +
  1306. + Modifications to support HyperbolaBSD:
  1307. + Copyright (C) 2020-2024 Hyperbola Project
  1308. +
  1309. + This file is part of GCC.
  1310. +
  1311. + GCC is free software; you can redistribute it and/or modify it
  1312. + under the terms of the GNU General Public License as published
  1313. + by the Free Software Foundation; either version 3, or (at your
  1314. + option) any later version.
  1315. +
  1316. + GCC is distributed in the hope that it will be useful, but WITHOUT
  1317. + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  1318. + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  1319. + License for more details.
  1320. +
  1321. + You should have received a copy of the GNU General Public License
  1322. + along with GCC; see the file COPYING3. If not see
  1323. + <http://www.gnu.org/licenses/>. */
  1324. +
  1325. +#include "config.h"
  1326. +#include "system.h"
  1327. +#include "coretypes.h"
  1328. +#include "hosthooks.h"
  1329. +#include "hosthooks-def.h"
  1330. +
  1331. +
  1332. +#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
  1333. +#define HOST_HOOKS_GT_PCH_GET_ADDRESS hyperbolabsd_gt_pch_get_address
  1334. +#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
  1335. +#define HOST_HOOKS_GT_PCH_USE_ADDRESS hyperbolabsd_gt_pch_use_address
  1336. +
  1337. +/* For various ports, try to guess a fixed spot in the vm space
  1338. + that's probably free. */
  1339. +#if defined(__amd64__)
  1340. +# define TRY_EMPTY_VM_SPACE 0x400000000000
  1341. +#elif defined(__i386__)
  1342. +# define TRY_EMPTY_VM_SPACE 0xb0000000
  1343. +#else
  1344. +# define TRY_EMPTY_VM_SPACE 0
  1345. +#endif
  1346. +
  1347. +/* Determine a location where we might be able to reliably allocate
  1348. + SIZE bytes. FD is the PCH file, though we should return with the
  1349. + file unmapped. */
  1350. +
  1351. +static void *
  1352. +hyperbolabsd_gt_pch_get_address (size_t size, int fd)
  1353. +{
  1354. + void *addr;
  1355. +
  1356. + addr = mmap ((void *) TRY_EMPTY_VM_SPACE, size, PROT_READ | PROT_WRITE,
  1357. + MAP_PRIVATE, fd, 0);
  1358. +
  1359. + /* If we failed the map, that means there's *no* free space. */
  1360. + if (addr == (void *) MAP_FAILED)
  1361. + return NULL;
  1362. + /* Unmap the area before returning. */
  1363. + munmap (addr, size);
  1364. +
  1365. + return addr;
  1366. +}
  1367. +
  1368. +/* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
  1369. + mapping the data at BASE, -1 if we couldn't. */
  1370. +
  1371. +static int
  1372. +hyperbolabsd_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
  1373. +{
  1374. + void *addr;
  1375. +
  1376. + /* We're called with size == 0 if we're not planning to load a PCH
  1377. + file at all. This allows the hook to free any static space that
  1378. + we might have allocated at link time. */
  1379. + if (size == 0)
  1380. + return -1;
  1381. +
  1382. + addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, offset);
  1383. +
  1384. + return addr == base ? 1 : -1;
  1385. +}
  1386. +
  1387. +
  1388. +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
  1389. diff --git b/gcc/config/hyperbolabsd-libpthread.h b/gcc/config/hyperbolabsd-libpthread.h
  1390. new file mode 100644
  1391. index 0000000..3e7a072
  1392. --- /dev/null
  1393. +++ b/gcc/config/hyperbolabsd-libpthread.h
  1394. @@ -0,0 +1,25 @@
  1395. +/* LIB_SPEC appropriate for OpenBSD. Include -lpthread if -pthread is
  1396. + specified on the command line. */
  1397. +/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
  1398. +
  1399. + Modifications to support HyperbolaBSD:
  1400. + Copyright (C) 2024 Hyperbola Project
  1401. +
  1402. + This file is part of GCC.
  1403. +
  1404. + GCC is free software; you can redistribute it and/or modify it
  1405. + under the terms of the GNU General Public License as published
  1406. + by the Free Software Foundation; either version 3, or (at your
  1407. + option) any later version.
  1408. +
  1409. + GCC is distributed in the hope that it will be useful, but WITHOUT
  1410. + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  1411. + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  1412. + License for more details.
  1413. +
  1414. + You should have received a copy of the GNU General Public License
  1415. + along with GCC; see the file COPYING3. If not see
  1416. + <http://www.gnu.org/licenses/>. */
  1417. +
  1418. +#define HBBSD_LIB_SPEC "%{pthread:-lpthread%{!shared:%{p|pg:_p}}} %{!shared:-lc%{p|pg:_p}}"
  1419. +
  1420. diff --git b/gcc/config/hyperbolabsd-stdint.h b/gcc/config/hyperbolabsd-stdint.h
  1421. new file mode 100644
  1422. index 0000000..2ee5dba
  1423. --- /dev/null
  1424. +++ b/gcc/config/hyperbolabsd-stdint.h
  1425. @@ -0,0 +1,61 @@
  1426. +/* Definitions for <stdint.h> types for HyperbolaBSD systems.
  1427. + Copyright (C) 2016-2018 Free Software Foundation, Inc.
  1428. +
  1429. + Modifications to support HyperbolaBSD:
  1430. + Copyright (C) 2020-2024 Hyperbola Project
  1431. +
  1432. +This file is part of GCC.
  1433. +
  1434. +GCC is free software; you can redistribute it and/or modify
  1435. +it under the terms of the GNU General Public License as published by
  1436. +the Free Software Foundation; either version 3, or (at your option)
  1437. +any later version.
  1438. +
  1439. +GCC is distributed in the hope that it will be useful,
  1440. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  1441. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1442. +GNU General Public License for more details.
  1443. +
  1444. +Under Section 7 of GPL version 3, you are granted additional
  1445. +permissions described in the GCC Runtime Library Exception, version
  1446. +3.1, as published by the Free Software Foundation.
  1447. +
  1448. +You should have received a copy of the GNU General Public License and
  1449. +a copy of the GCC Runtime Library Exception along with this program;
  1450. +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  1451. +<http://www.gnu.org/licenses/>. */
  1452. +
  1453. +#define SIG_ATOMIC_TYPE "int"
  1454. +
  1455. +#define INT8_TYPE "signed char"
  1456. +#define INT16_TYPE "short int"
  1457. +#define INT32_TYPE "int"
  1458. +#define INT64_TYPE "long long int"
  1459. +#define UINT8_TYPE "unsigned char"
  1460. +#define UINT16_TYPE "short unsigned int"
  1461. +#define UINT32_TYPE "unsigned int"
  1462. +#define UINT64_TYPE "long long unsigned int"
  1463. +
  1464. +#define INT_LEAST8_TYPE "signed char"
  1465. +#define INT_LEAST16_TYPE "short int"
  1466. +#define INT_LEAST32_TYPE "int"
  1467. +#define INT_LEAST64_TYPE "long long int"
  1468. +#define UINT_LEAST8_TYPE "unsigned char"
  1469. +#define UINT_LEAST16_TYPE "short unsigned int"
  1470. +#define UINT_LEAST32_TYPE "unsigned int"
  1471. +#define UINT_LEAST64_TYPE "long long unsigned int"
  1472. +
  1473. +#define INT_FAST8_TYPE "int"
  1474. +#define INT_FAST16_TYPE "int"
  1475. +#define INT_FAST32_TYPE "int"
  1476. +#define INT_FAST64_TYPE "long long int"
  1477. +#define UINT_FAST8_TYPE "unsigned int"
  1478. +#define UINT_FAST16_TYPE "unsigned int"
  1479. +#define UINT_FAST32_TYPE "unsigned int"
  1480. +#define UINT_FAST64_TYPE "long long unsigned int"
  1481. +
  1482. +#define INTMAX_TYPE "long long int"
  1483. +#define UINTMAX_TYPE "long long unsigned int"
  1484. +
  1485. +#define INTPTR_TYPE "long int"
  1486. +#define UINTPTR_TYPE "long unsigned int"
  1487. diff --git b/gcc/config/hyperbolabsd.h b/gcc/config/hyperbolabsd.h
  1488. new file mode 100644
  1489. index 0000000..861dff2
  1490. --- /dev/null
  1491. +++ b/gcc/config/hyperbolabsd.h
  1492. @@ -0,0 +1,254 @@
  1493. +/* Base configuration file for all HyperbolaBSD targets.
  1494. + Copyright (C) 1999-2018 Free Software Foundation, Inc.
  1495. +
  1496. + Modifications to support HyperbolaBSD:
  1497. + Copyright (C) 2020-2024 Hyperbola Project
  1498. +
  1499. +This file is part of GCC.
  1500. +
  1501. +GCC is free software; you can redistribute it and/or modify
  1502. +it under the terms of the GNU General Public License as published by
  1503. +the Free Software Foundation; either version 3, or (at your option)
  1504. +any later version.
  1505. +
  1506. +GCC is distributed in the hope that it will be useful,
  1507. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  1508. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1509. +GNU General Public License for more details.
  1510. +
  1511. +You should have received a copy of the GNU General Public License
  1512. +along with GCC; see the file COPYING3. If not see
  1513. +<http://www.gnu.org/licenses/>. */
  1514. +
  1515. +/* Common HyperbolaBSD configuration.
  1516. + All HyperbolaBSD architectures include this file, which is intended as
  1517. + a repository for common defines.
  1518. +
  1519. + Some defines are common to all architectures, a few of them are
  1520. + triggered by HBBSD_* guards, so that we won't override architecture
  1521. + defaults by mistakes.
  1522. +
  1523. + HBBSD_HAS_CORRECT_SPECS:
  1524. + another mechanism provides correct specs already.
  1525. + HBBSD_NO_DYNAMIC_LIBRARIES:
  1526. + no implementation of dynamic libraries.
  1527. + HBBSD_HAS_DECLARE_FUNCTION_NAME, HBBSD_HAS_DECLARE_FUNCTION_SIZE,
  1528. + HBBSD_HAS_DECLARE_OBJECT:
  1529. + PIC support, FUNCTION_NAME/FUNCTION_SIZE are independent, whereas
  1530. + the corresponding logic for OBJECTS is necessarily coupled.
  1531. +
  1532. + There are also a few `default' defines such as ASM_WEAKEN_LABEL,
  1533. + intended as common ground for arch that don't provide
  1534. + anything suitable. */
  1535. +
  1536. +/* Controlling the compilation driver. */
  1537. +/* TARGET_OS_CPP_BUILTINS() common to all HyperbolaBSD targets. */
  1538. +#define HYPERBOLABSD_OS_CPP_BUILTINS() \
  1539. + do \
  1540. + { \
  1541. + builtin_define ("__HyperbolaBSD__"); \
  1542. + builtin_define ("__unix__"); \
  1543. + builtin_define ("__ANSI_COMPAT"); \
  1544. + builtin_assert ("system=unix"); \
  1545. + builtin_assert ("system=bsd"); \
  1546. + builtin_assert ("system=HyperbolaBSD"); \
  1547. + } \
  1548. + while (0)
  1549. +
  1550. +/* TARGET_OS_CPP_BUILTINS() common to all HyperbolaBSD ELF targets. */
  1551. +#define HYPERBOLABSD_OS_CPP_BUILTINS_ELF() \
  1552. + do \
  1553. + { \
  1554. + HYPERBOLABSD_OS_CPP_BUILTINS(); \
  1555. + builtin_define ("__ELF__"); \
  1556. + } \
  1557. +while (0)
  1558. +
  1559. +/* TARGET_OS_CPP_BUILTINS() common to all LP64 HyperbolaBSD targets. */
  1560. +#define HYPERBOLABSD_OS_CPP_BUILTINS_LP64() \
  1561. + do \
  1562. + { \
  1563. + builtin_define ("_LP64"); \
  1564. + builtin_define ("__LP64__"); \
  1565. + } \
  1566. + while (0)
  1567. +
  1568. +/* CPP_SPEC appropriate for HyperbolaBSD. We deal with -posix and -pthread.
  1569. + XXX the way threads are handled currently is not very satisfying,
  1570. + since all code must be compiled with -pthread to work.
  1571. + This two-stage defines makes it easy to pick that for targets that
  1572. + have subspecs. */
  1573. +#ifdef CPP_CPU_SPEC
  1574. +#define HBBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
  1575. +#else
  1576. +#define HBBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
  1577. +#endif
  1578. +
  1579. +#undef LIB_SPEC
  1580. +#define LIB_SPEC HBBSD_LIB_SPEC
  1581. +
  1582. +#ifndef HBBSD_HAS_CORRECT_SPECS
  1583. +
  1584. +#undef CPP_SPEC
  1585. +#define CPP_SPEC HBBSD_CPP_SPEC
  1586. +
  1587. +/* Since we use gas, stdin -> - is a good idea. */
  1588. +#define AS_NEEDS_DASH_FOR_PIPED_INPUT
  1589. +
  1590. +#undef LIB_SPEC
  1591. +#define LIB_SPEC HBBSD_LIB_SPEC
  1592. +
  1593. +#if defined(HAVE_LD_EH_FRAME_HDR)
  1594. +#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
  1595. +#endif
  1596. +
  1597. +#undef LIB_SPEC
  1598. +#define LIB_SPEC HBBSD_LIB_SPEC
  1599. +#endif
  1600. +
  1601. +#define TARGET_POSIX_IO
  1602. +
  1603. +
  1604. +/* Runtime target specification. */
  1605. +
  1606. +/* Miscellaneous parameters. */
  1607. +
  1608. +/* Controlling debugging info: dbx options. */
  1609. +
  1610. +/* Don't use the `xsTAG;' construct in DBX output; HyperbolaBSD systems that
  1611. + use DBX don't support it. */
  1612. +#define DBX_NO_XREFS
  1613. +
  1614. +
  1615. +/* - we use . - _func instead of a local label,
  1616. + - we put extra spaces in expressions such as
  1617. + .type _func , @function
  1618. + This is more readable for a human being and confuses c++filt less. */
  1619. +
  1620. +/* Assembler format: output and generation of labels. */
  1621. +
  1622. +/* Define the strings used for the .type and .size directives.
  1623. + These strings generally do not vary from one system running HyperbolaBSD
  1624. + to another, but if a given system needs to use different pseudo-op
  1625. + names for these, they may be overridden in the arch specific file. */
  1626. +
  1627. +/* HyperbolaBSD assembler is hacked to have .type & .size support even in a.out
  1628. + format object files. Functions size are supported but not activated
  1629. + yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c).
  1630. + SET_ASM_OP is needed for attribute alias to work. */
  1631. +
  1632. +#undef TYPE_ASM_OP
  1633. +#undef SIZE_ASM_OP
  1634. +#undef SET_ASM_OP
  1635. +#undef GLOBAL_ASM_OP
  1636. +
  1637. +#define TYPE_ASM_OP "\t.type\t"
  1638. +#define SIZE_ASM_OP "\t.size\t"
  1639. +#define SET_ASM_OP "\t.set\t"
  1640. +#define GLOBAL_ASM_OP "\t.globl\t"
  1641. +
  1642. +/* The following macro defines the format used to output the second
  1643. + operand of the .type assembler directive. */
  1644. +#undef TYPE_OPERAND_FMT
  1645. +#define TYPE_OPERAND_FMT "@%s"
  1646. +
  1647. +/* Provision if extra assembler code is needed to declare a function's result
  1648. + (taken from svr4, not needed yet actually). */
  1649. +#ifndef ASM_DECLARE_RESULT
  1650. +#define ASM_DECLARE_RESULT(FILE, RESULT)
  1651. +#endif
  1652. +
  1653. +/* These macros generate the special .type and .size directives which
  1654. + are used to set the corresponding fields of the linker symbol table
  1655. + entries under HyperbolaBSD. These macros also have to output the starting
  1656. + labels for the relevant functions/objects. */
  1657. +
  1658. +#ifndef HBBSD_HAS_DECLARE_FUNCTION_NAME
  1659. +/* Extra assembler code needed to declare a function properly.
  1660. + Some assemblers may also need to also have something extra said
  1661. + about the function's return value. We allow for that here. */
  1662. +#undef ASM_DECLARE_FUNCTION_NAME
  1663. +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
  1664. + do { \
  1665. + ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
  1666. + ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
  1667. + ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \
  1668. + } while (0)
  1669. +#endif
  1670. +
  1671. +#ifndef HBBSD_HAS_DECLARE_FUNCTION_SIZE
  1672. +/* Declare the size of a function. */
  1673. +#undef ASM_DECLARE_FUNCTION_SIZE
  1674. +#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
  1675. + do { \
  1676. + if (!flag_inhibit_size_directive) \
  1677. + ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
  1678. + } while (0)
  1679. +#endif
  1680. +
  1681. +#ifndef HBBSD_HAS_DECLARE_OBJECT
  1682. +/* Extra assembler code needed to declare an object properly. */
  1683. +#undef ASM_DECLARE_OBJECT_NAME
  1684. +#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
  1685. + do { \
  1686. + HOST_WIDE_INT size; \
  1687. + ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
  1688. + size_directive_output = 0; \
  1689. + if (!flag_inhibit_size_directive \
  1690. + && (DECL) && DECL_SIZE (DECL)) \
  1691. + { \
  1692. + size_directive_output = 1; \
  1693. + size = int_size_in_bytes (TREE_TYPE (DECL)); \
  1694. + ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
  1695. + } \
  1696. + ASM_OUTPUT_LABEL (FILE, NAME); \
  1697. + } while (0)
  1698. +
  1699. +/* Output the size directive for a decl in rest_of_decl_compilation
  1700. + in the case where we did not do so before the initializer.
  1701. + Once we find the error_mark_node, we know that the value of
  1702. + size_directive_output was set by ASM_DECLARE_OBJECT_NAME
  1703. + when it was run for the same decl. */
  1704. +#undef ASM_FINISH_DECLARE_OBJECT
  1705. +#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
  1706. +do { \
  1707. + const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
  1708. + HOST_WIDE_INT size; \
  1709. + if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
  1710. + && ! AT_END && TOP_LEVEL \
  1711. + && DECL_INITIAL (DECL) == error_mark_node \
  1712. + && !size_directive_output) \
  1713. + { \
  1714. + size_directive_output = 1; \
  1715. + size = int_size_in_bytes (TREE_TYPE (DECL)); \
  1716. + ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
  1717. + } \
  1718. + } while (0)
  1719. +#endif
  1720. +
  1721. +
  1722. +/* Those are `generic' ways to weaken/globalize a label. We shouldn't need
  1723. + to override a processor specific definition. Hence, #ifndef ASM_*
  1724. + In case overriding turns out to be needed, one can always #undef ASM_*
  1725. + before including this file. */
  1726. +
  1727. +/* Tell the assembler that a symbol is weak. */
  1728. +/* Note: netbsd arm32 assembler needs a .globl here. An override may
  1729. + be needed when/if we go for arm32 support. */
  1730. +#ifndef ASM_WEAKEN_LABEL
  1731. +#define ASM_WEAKEN_LABEL(FILE,NAME) \
  1732. + do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
  1733. + fputc ('\n', FILE); } while (0)
  1734. +#endif
  1735. +
  1736. +/* Storage layout. */
  1737. +
  1738. +
  1739. +#define HAVE_ENABLE_EXECUTE_STACK
  1740. +
  1741. +/* Don't assume anything about the header files. */
  1742. +#undef NO_IMPLICIT_EXTERN_C
  1743. +#define NO_IMPLICIT_EXTERN_C 1
  1744. +
  1745. +#include <sys/types.h>
  1746. +#include <sys/mman.h>
  1747. diff --git b/gcc/config/hyperbolabsd.opt b/gcc/config/hyperbolabsd.opt
  1748. new file mode 100644
  1749. index 0000000..29f5eb1
  1750. --- /dev/null
  1751. +++ b/gcc/config/hyperbolabsd.opt
  1752. @@ -0,0 +1,38 @@
  1753. +; HyperbolaBSD options.
  1754. +
  1755. +; Copyright (C) 2010-2018 Free Software Foundation, Inc.
  1756. +;
  1757. +; Modifications to support HyperbolaBSD:
  1758. +; Copyright (C) 2020-2024 Hyperbola Project
  1759. +;
  1760. +; This file is part of GCC.
  1761. +;
  1762. +; GCC is free software; you can redistribute it and/or modify it under
  1763. +; the terms of the GNU General Public License as published by the Free
  1764. +; Software Foundation; either version 3, or (at your option) any later
  1765. +; version.
  1766. +;
  1767. +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  1768. +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
  1769. +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  1770. +; for more details.
  1771. +;
  1772. +; You should have received a copy of the GNU General Public License
  1773. +; along with GCC; see the file COPYING3. If not see
  1774. +; <http://www.gnu.org/licenses/>.
  1775. +
  1776. +; See the GCC internals manual (options.texi) for a description of
  1777. +; this file's format.
  1778. +
  1779. +; Please try to keep this file in ASCII collating order.
  1780. +
  1781. +assert=
  1782. +Driver JoinedOrMissing
  1783. +
  1784. +posix
  1785. +Driver
  1786. +
  1787. +pthread
  1788. +Driver
  1789. +
  1790. +; This comment is to ensure we retain the blank line above.
  1791. diff --git b/gcc/config/i386/hyperbolabsd.h b/gcc/config/i386/hyperbolabsd.h
  1792. new file mode 100644
  1793. index 0000000..47920a5
  1794. --- /dev/null
  1795. +++ b/gcc/config/i386/hyperbolabsd.h
  1796. @@ -0,0 +1,119 @@
  1797. +/* Configuration for an HyperbolaBSD i386 target.
  1798. +
  1799. + Copyright (C) 2005-2018 Free Software Foundation, Inc.
  1800. +
  1801. + Modifications to support HyperbolaBSD:
  1802. + Copyright (C) 2020-2024 Hyperbola Project
  1803. +
  1804. +This file is part of GCC.
  1805. +
  1806. +GCC is free software; you can redistribute it and/or modify
  1807. +it under the terms of the GNU General Public License as published by
  1808. +the Free Software Foundation; either version 3, or (at your option)
  1809. +any later version.
  1810. +
  1811. +GCC is distributed in the hope that it will be useful,
  1812. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  1813. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1814. +GNU General Public License for more details.
  1815. +
  1816. +You should have received a copy of the GNU General Public License
  1817. +along with GCC; see the file COPYING3. If not see
  1818. +<http://www.gnu.org/licenses/>. */
  1819. +
  1820. +#define TARGET_OS_CPP_BUILTINS() \
  1821. + do \
  1822. + { \
  1823. + HYPERBOLABSD_OS_CPP_BUILTINS(); \
  1824. + } \
  1825. + while (0)
  1826. +
  1827. +#undef DBX_REGISTER_NUMBER
  1828. +#define DBX_REGISTER_NUMBER(n) \
  1829. + (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
  1830. +
  1831. +/* This must agree with <machine/ansi.h>. */
  1832. +#undef SIZE_TYPE
  1833. +#define SIZE_TYPE "long unsigned int"
  1834. +
  1835. +#undef PTRDIFF_TYPE
  1836. +#define PTRDIFF_TYPE "long int"
  1837. +
  1838. +#undef WCHAR_TYPE
  1839. +#define WCHAR_TYPE "int"
  1840. +
  1841. +#undef WCHAR_TYPE_SIZE
  1842. +#define WCHAR_TYPE_SIZE 32
  1843. +
  1844. +#undef WINT_TYPE
  1845. +#define WINT_TYPE "int"
  1846. +
  1847. +/* Don't default to pcc-struct-return, because gcc is the only compiler, and
  1848. + we want to retain compatibility with older gcc versions. */
  1849. +
  1850. +#undef DEFAULT_PCC_STRUCT_RETURN
  1851. +#define DEFAULT_PCC_STRUCT_RETURN 0
  1852. +
  1853. +/* Override the default comment-starter of "/". */
  1854. +#undef ASM_COMMENT_START
  1855. +#define ASM_COMMENT_START "#"
  1856. +
  1857. +#undef ASM_APP_ON
  1858. +#define ASM_APP_ON "#APP\n"
  1859. +
  1860. +#undef ASM_APP_OFF
  1861. +#define ASM_APP_OFF "#NO_APP\n"
  1862. +
  1863. +/* A C statement to output to the stdio stream FILE an assembler
  1864. + command to advance the location counter to a multiple of 1<<LOG
  1865. + bytes if it is within MAX_SKIP bytes.
  1866. +
  1867. + This is used to align code labels according to Intel recommendations. */
  1868. +
  1869. +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
  1870. +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
  1871. + do { \
  1872. + if ((LOG) != 0) { \
  1873. + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
  1874. + else { \
  1875. + fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
  1876. + /* Make sure that we have at least 8 byte alignment if > 8 byte \
  1877. + alignment is preferred. */ \
  1878. + if ((LOG) > 3 \
  1879. + && (1 << (LOG)) > ((MAX_SKIP) + 1) \
  1880. + && (MAX_SKIP) >= 7) \
  1881. + fputs ("\t.p2align 3\n", (FILE)); \
  1882. + } \
  1883. + } \
  1884. + } while (0)
  1885. +#endif
  1886. +
  1887. +/* HyperbolaBSD's profiler recovers all information from the stack pointer.
  1888. + The icky part is not here, but in <machine/profile.h>. */
  1889. +#undef FUNCTION_PROFILER
  1890. +#define FUNCTION_PROFILER(FILE, LABELNO) \
  1891. + fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
  1892. +
  1893. +#undef LINK_SPEC
  1894. +#define LINK_SPEC \
  1895. + "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \
  1896. + %{shared:-shared} %{R*} \
  1897. + %{static:-Bstatic} \
  1898. + %{!static:-Bdynamic} \
  1899. + %{rdynamic:-export-dynamic} \
  1900. + %{assert*} \
  1901. + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
  1902. + %{!nostdlib:-L/lib -L/usr/lib}"
  1903. +
  1904. +#undef STARTFILE_SPEC
  1905. +#define STARTFILE_SPEC "\
  1906. + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
  1907. + %{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \
  1908. + %{!nopie:rcrt0%O%s}}}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
  1909. +
  1910. +#undef ENDFILE_SPEC
  1911. +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
  1912. +
  1913. +#define HBBSD_HAS_CORRECT_SPECS
  1914. +
  1915. +#define HAVE_ENABLE_EXECUTE_STACK
  1916. diff --git b/gcc/config/i386/hyperbolabsd64.h b/gcc/config/i386/hyperbolabsd64.h
  1917. new file mode 100644
  1918. index 0000000..d93aa51
  1919. --- /dev/null
  1920. +++ b/gcc/config/i386/hyperbolabsd64.h
  1921. @@ -0,0 +1,102 @@
  1922. +/* Configuration for an HyperbolaBSD x86_64 target.
  1923. +
  1924. + Copyright (C) 2003-2018 Free Software Foundation, Inc.
  1925. +
  1926. + Modifications to support HyperbolaBSD:
  1927. + Copyright (C) 2020-2024 Hyperbola Project
  1928. +
  1929. +This file is part of GCC.
  1930. +
  1931. +GCC is free software; you can redistribute it and/or modify
  1932. +it under the terms of the GNU General Public License as published by
  1933. +the Free Software Foundation; either version 3, or (at your option)
  1934. +any later version.
  1935. +
  1936. +GCC is distributed in the hope that it will be useful,
  1937. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  1938. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1939. +GNU General Public License for more details.
  1940. +
  1941. +You should have received a copy of the GNU General Public License
  1942. +along with GCC; see the file COPYING3. If not see
  1943. +<http://www.gnu.org/licenses/>. */
  1944. +
  1945. +#define TARGET_OS_CPP_BUILTINS() \
  1946. + do \
  1947. + { \
  1948. + HYPERBOLABSD_OS_CPP_BUILTINS_ELF(); \
  1949. + if (TARGET_64BIT) \
  1950. + HYPERBOLABSD_OS_CPP_BUILTINS_LP64(); \
  1951. + } \
  1952. + while (0)
  1953. +
  1954. +/* This must agree with <machine/_types.h>. */
  1955. +#undef SIZE_TYPE
  1956. +#define SIZE_TYPE "long unsigned int"
  1957. +
  1958. +#undef PTRDIFF_TYPE
  1959. +#define PTRDIFF_TYPE "long int"
  1960. +
  1961. +#undef WCHAR_TYPE
  1962. +#define WCHAR_TYPE "int"
  1963. +
  1964. +#undef WCHAR_TYPE_SIZE
  1965. +#define WCHAR_TYPE_SIZE 32
  1966. +
  1967. +#undef WINT_TYPE
  1968. +#define WINT_TYPE "int"
  1969. +
  1970. +#undef INTMAX_TYPE
  1971. +#define INTMAX_TYPE "long long int"
  1972. +
  1973. +#undef UINTMAX_TYPE
  1974. +#define UINTMAX_TYPE "long long unsigned int"
  1975. +
  1976. +/* Don't default to pcc-struct-return, because gcc is the only compiler, and
  1977. + we want to retain compatibility with older gcc versions. */
  1978. +
  1979. +#undef DEFAULT_PCC_STRUCT_RETURN
  1980. +#define DEFAULT_PCC_STRUCT_RETURN 0
  1981. +
  1982. +/* Override the default comment-starter of "/". */
  1983. +#undef ASM_COMMENT_START
  1984. +#define ASM_COMMENT_START "#"
  1985. +
  1986. +#undef ASM_APP_ON
  1987. +#define ASM_APP_ON "#APP\n"
  1988. +
  1989. +#undef ASM_APP_OFF
  1990. +#define ASM_APP_OFF "#NO_APP\n"
  1991. +
  1992. +/* HyperbolaBSD's profiler recovers all information from the stack pointer.
  1993. + The icky part is not here, but in <machine/profile.h>. */
  1994. +#undef FUNCTION_PROFILER
  1995. +#define FUNCTION_PROFILER(FILE, LABELNO) \
  1996. + fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
  1997. +
  1998. +#undef LINK_SPEC
  1999. +#define LINK_SPEC \
  2000. + "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \
  2001. + %{shared:-shared} %{R*} \
  2002. + %{static:-Bstatic} \
  2003. + %{!static:-Bdynamic} \
  2004. + %{rdynamic:-export-dynamic} \
  2005. + %{assert*} \
  2006. + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
  2007. + %{!nostdlib:-L/lib -L/usr/lib}"
  2008. +
  2009. +#undef STARTFILE_SPEC
  2010. +#define STARTFILE_SPEC "\
  2011. + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
  2012. + %{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \
  2013. + %{!nopie:rcrt0%O%s}}}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
  2014. +
  2015. +#undef ENDFILE_SPEC
  2016. +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
  2017. +
  2018. +#define HBBSD_HAS_CORRECT_SPECS
  2019. +
  2020. +#define HAVE_ENABLE_EXECUTE_STACK
  2021. +
  2022. +#undef JUMP_TABLES_IN_TEXT_SECTION
  2023. +#define JUMP_TABLES_IN_TEXT_SECTION 0
  2024. diff --git b/gcc/config/rs6000/hyperbolabsd.h b/gcc/config/rs6000/hyperbolabsd.h
  2025. new file mode 100644
  2026. index 0000000..b32f84e
  2027. --- /dev/null
  2028. +++ b/gcc/config/rs6000/hyperbolabsd.h
  2029. @@ -0,0 +1,132 @@
  2030. +/* Definitions for PowerPC running HyperbolaBSD using the ELF format
  2031. + Copyright (C) 1999, 2001-2018 Free Software Foundation, Inc.
  2032. + Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
  2033. +
  2034. + Modifications to support HyperbolaBSD:
  2035. + Copyright (C) 2024 Hyperbola Project
  2036. +
  2037. + This file is part of GCC.
  2038. +
  2039. + GCC is free software; you can redistribute it and/or modify it
  2040. + under the terms of the GNU General Public License as published
  2041. + by the Free Software Foundation; either version 3, or (at your
  2042. + option) any later version.
  2043. +
  2044. + GCC is distributed in the hope that it will be useful, but WITHOUT
  2045. + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  2046. + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  2047. + License for more details.
  2048. +
  2049. + You should have received a copy of the GNU General Public License
  2050. + along with GCC; see the file COPYING3. If not see
  2051. + <http://www.gnu.org/licenses/>. */
  2052. +
  2053. +/* Override the defaults, which exist to force the proper definition. */
  2054. +
  2055. +/* XXX need to check ASM_WEAKEN_LABEL/ASM_GLOBALIZE_LABEL. */
  2056. +
  2057. +/* Run-time target specifications. */
  2058. +#undef TARGET_OS_CPP_BUILTINS /* FIXME: sysv4.h should not define this! */
  2059. +#define TARGET_OS_CPP_BUILTINS() \
  2060. + do \
  2061. + { \
  2062. + HYPERBOLABSD_OS_CPP_BUILTINS_ELF(); \
  2063. + builtin_define ("__PPC"); \
  2064. + builtin_define ("__PPC__"); \
  2065. + builtin_define ("__powerpc"); \
  2066. + builtin_define ("__powerpc__"); \
  2067. + builtin_assert ("cpu=powerpc"); \
  2068. + builtin_assert ("machine=powerpc"); \
  2069. + } \
  2070. + while (0)
  2071. +
  2072. +/* Override the default from rs6000.h to avoid conflicts with macros
  2073. + defined in HyperbolaBSD header files. */
  2074. +
  2075. +#undef RS6000_CPU_CPP_ENDIAN_BUILTINS
  2076. +#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
  2077. + do \
  2078. + { \
  2079. + if (BYTES_BIG_ENDIAN) \
  2080. + { \
  2081. + builtin_define ("__BIG_ENDIAN__"); \
  2082. + builtin_assert ("machine=bigendian"); \
  2083. + } \
  2084. + else \
  2085. + { \
  2086. + builtin_define ("__LITTLE_ENDIAN__"); \
  2087. + builtin_assert ("machine=littleendian"); \
  2088. + } \
  2089. + } \
  2090. + while (0)
  2091. +
  2092. +#undef LINK_SPEC
  2093. +#define LINK_SPEC "%{shared:-shared} \
  2094. + %{!shared: \
  2095. + %{!static: \
  2096. + %{rdynamic:-export-dynamic} \
  2097. + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
  2098. + %{static:-static}}"
  2099. +
  2100. +#undef CPP_OS_DEFAULT_SPEC
  2101. +#define CPP_OS_DEFAULT_SPEC "%(cpp_os_hyperbolabsd)"
  2102. +
  2103. +#undef STARTFILE_DEFAULT_SPEC
  2104. +#define STARTFILE_DEFAULT_SPEC "%(startfile_hyperbolabsd)"
  2105. +
  2106. +#undef ENDFILE_DEFAULT_SPEC
  2107. +#define ENDFILE_DEFAULT_SPEC "%(endfile_hyperbolabsd)"
  2108. +
  2109. +#undef LIB_DEFAULT_SPEC
  2110. +#define LIB_DEFAULT_SPEC "%(lib_hyperbolabsd)"
  2111. +
  2112. +#undef LINK_START_DEFAULT_SPEC
  2113. +#define LINK_START_DEFAULT_SPEC "%(link_start_hyperbolabsd)"
  2114. +
  2115. +#undef LINK_OS_DEFAULT_SPEC
  2116. +#define LINK_OS_DEFAULT_SPEC "%(link_os_hyperbolabsd)"
  2117. +
  2118. +#undef CRTSAVRES_DEFAULT_SPEC
  2119. +#define CRTSAVRES_DEFAULT_SPEC ""
  2120. +
  2121. +/* Default ABI to use */
  2122. +#undef RS6000_ABI_NAME
  2123. +#define RS6000_ABI_NAME "hyperbolabsd"
  2124. +
  2125. +/************************[ Target stuff ]***********************************/
  2126. +
  2127. +/* Define this macro as a C expression for the initializer of an
  2128. + array of string to tell the driver program which options are
  2129. + defaults for this target and thus do not need to be handled
  2130. + specially when using `MULTILIB_OPTIONS'.
  2131. +
  2132. + Do not define this macro if `MULTILIB_OPTIONS' is not defined in
  2133. + the target makefile fragment or if none of the options listed in
  2134. + `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
  2135. +
  2136. +#undef MULTILIB_DEFAULTS
  2137. +#define MULTILIB_DEFAULTS { "mbig", "mcall-hyperbolabsd" }
  2138. +
  2139. +/* Don't tell collect2 we use COFF as we don't have (yet ?) a dynamic ld
  2140. + library with the proper functions to handle this -> collect2 will
  2141. + default to using nm. */
  2142. +#undef OBJECT_FORMAT_COFF
  2143. +
  2144. +/* Define the actual types of some ANSI-mandated types.
  2145. + Needs to agree with <machine/_types.h>. GCC defaults come from c-decl.c,
  2146. + c-common.c, and config/<arch>/<arch>.h. */
  2147. +
  2148. +#undef SIZE_TYPE
  2149. +#define SIZE_TYPE "long unsigned int"
  2150. +
  2151. +#undef WCHAR_TYPE
  2152. +#define WCHAR_TYPE "int"
  2153. +
  2154. +#undef WCHAR_TYPE_SIZE
  2155. +#define WCHAR_TYPE_SIZE 32
  2156. +
  2157. +#undef PTRDIFF_TYPE
  2158. +#define PTRDIFF_TYPE "long int"
  2159. +
  2160. +#undef TRAMPOLINE_SIZE
  2161. +#define TRAMPOLINE_SIZE 40
  2162. diff --git b/gcc/config/t-hyperbolabsd b/gcc/config/t-hyperbolabsd
  2163. new file mode 100644
  2164. index 0000000..7637da0
  2165. --- /dev/null
  2166. +++ b/gcc/config/t-hyperbolabsd
  2167. @@ -0,0 +1,2 @@
  2168. +# We don't need GCC's own include files.
  2169. +USER_H = $(EXTRA_HEADERS)
  2170. diff --git b/gcc/config/x-hyperbolabsd b/gcc/config/x-hyperbolabsd
  2171. new file mode 100644
  2172. index 0000000..a0c7a48
  2173. --- /dev/null
  2174. +++ b/gcc/config/x-hyperbolabsd
  2175. @@ -0,0 +1,4 @@
  2176. +host-hyperbolabsd.o : $(srcdir)/config/host-hyperbolabsd.c $(CONFIG_H) $(SYSTEM_H) \
  2177. + coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H)
  2178. + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  2179. + $(srcdir)/config/host-hyperbolabsd.c
  2180. diff --git a/gcc/config.gcc b/gcc/config.gcc
  2181. index af9d122..856f2ff 100644
  2182. --- a/gcc/config.gcc
  2183. +++ b/gcc/config.gcc
  2184. @@ -1,6 +1,9 @@
  2185. # GCC target-specific configuration file.
  2186. # Copyright (C) 1997-2018 Free Software Foundation, Inc.
  2187. +# Modifications to support HyperbolaBSD:
  2188. +# Copyright (C) 2020-2024 Hyperbola Project
  2189. +
  2190. #This file is part of GCC.
  2191. #GCC is free software; you can redistribute it and/or modify it under
  2192. @@ -831,6 +834,19 @@ case ${target} in
  2193. ;;
  2194. esac
  2195. ;;
  2196. +*-*-hyperbolabsd*)
  2197. + tmake_file="t-hyperbolabsd"
  2198. + extra_options="${extra_options} hyperbolabsd.opt"
  2199. + gas=yes
  2200. + gnu_ld=yes
  2201. + case ${enable_threads} in
  2202. + yes)
  2203. + thread_file='posix'
  2204. + ;;
  2205. + esac
  2206. + hbbsd_tm_file="hyperbolabsd.h hyperbolabsd-stdint.h hyperbolabsd-libpthread.h"
  2207. + default_use_cxa_atexit=yes
  2208. + ;;
  2209. *-*-phoenix*)
  2210. gas=yes
  2211. gnu_ld=yes
  2212. @@ -1131,6 +1147,11 @@ arm*-*-netbsdelf*)
  2213. tmake_file="${tmake_file} arm/t-arm"
  2214. target_cpu_cname="arm6"
  2215. ;;
  2216. +arm*-*-hyperbolabsd*)
  2217. + tm_file="dbxelf.h elfos.h arm/hyperbolabsd_bpabi.h arm/elf.h ${tm_file}"
  2218. + tm_file="${tm_file} ${hbbsd_tm_file} arm/hyperbolabsd.h"
  2219. + target_cpu_cname="generic-armv7-a"
  2220. + ;;
  2221. arm*-*-linux-*) # ARM GNU/Linux with ELF
  2222. tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  2223. extra_options="${extra_options} linux-android.opt"
  2224. @@ -1554,6 +1575,14 @@ x86_64-*-openbsd*)
  2225. gas=yes
  2226. gnu_ld=yes
  2227. ;;
  2228. +i[34567]86-*-hyperbolabsd*)
  2229. + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
  2230. + tm_file="${tm_file} ${hbbsd_tm_file} i386/hyperbolabsd.h"
  2231. + ;;
  2232. +x86_64-*-hyperbolabsd*)
  2233. + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
  2234. + tm_file="${tm_file} ${hbbsd_tm_file} i386/x86-64.h i386/hyperbolabsd64.h"
  2235. + ;;
  2236. i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
  2237. # Intel 80386's running GNU/*
  2238. # with ELF format using glibc 2
  2239. @@ -2444,6 +2473,11 @@ powerpc-*-netbsd*)
  2240. tmake_file="${tmake_file} rs6000/t-netbsd"
  2241. extra_options="${extra_options} rs6000/sysv4.opt"
  2242. ;;
  2243. +powerpc-*-hyperbolabsd*)
  2244. + tm_file="rs6000/rs6000.h rs6000/hyperbolabsd.h dbxelf.h elfos.h ${tm_file}"
  2245. + tm_file="${tm_file} ${hbbsd_tm_file} exec-stack.h"
  2246. + tmake_file="${tmake_file} rs6000/t-ppcos"
  2247. + ;;
  2248. powerpc-*-eabispe*)
  2249. tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h ${cpu_type}/sysv4.h ${cpu_type}/eabi.h ${cpu_type}/e500.h ${cpu_type}/eabispe.h"
  2250. extra_options="${extra_options} ${cpu_type}/sysv4.opt"
  2251. diff --git a/gcc/config.host b/gcc/config.host
  2252. index c65569d..ba235d6 100644
  2253. --- a/gcc/config.host
  2254. +++ b/gcc/config.host
  2255. @@ -1,6 +1,9 @@
  2256. # GCC host-specific configuration file.
  2257. # Copyright (C) 1997-2018 Free Software Foundation, Inc.
  2258. +# Modifications to support HyperbolaBSD:
  2259. +# Copyright (C) 2020-2024 Hyperbola Project
  2260. +
  2261. #This file is part of GCC.
  2262. #GCC is free software; you can redistribute it and/or modify it under
  2263. @@ -282,6 +285,10 @@ case ${host} in
  2264. out_host_hook_obj=host-openbsd.o
  2265. host_xmake_file="${host_xmake_file} x-openbsd"
  2266. ;;
  2267. + *-*-hyperbolabsd*)
  2268. + out_host_hook_obj=host-hyperbolabsd.o
  2269. + host_xmake_file="${host_xmake_file} x-hyperbolabsd"
  2270. + ;;
  2271. ia64-*-hpux*)
  2272. use_long_long_for_widest_fast_int=yes
  2273. out_host_hook_obj=host-hpux.o
  2274. diff --git a/gcc/configure b/gcc/configure
  2275. index aa37763..95655d6 100755
  2276. --- a/gcc/configure
  2277. +++ b/gcc/configure
  2278. @@ -6,6 +6,9 @@
  2279. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  2280. # Foundation, Inc.
  2281. #
  2282. +# Modifications to support HyperbolaBSD:
  2283. +# Copyright (C) 2020-2024 Hyperbola Project
  2284. +#
  2285. # This configure script is free software; the Free Software Foundation
  2286. # gives unlimited permission to copy, distribute and modify it.
  2287. ## -------------------- ##
  2288. @@ -13010,7 +13013,7 @@ else
  2289. lt_cv_sys_max_cmd_len=8192;
  2290. ;;
  2291. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  2292. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  2293. # This has been around since 386BSD, at least. Likely further.
  2294. if test -x /sbin/sysctl; then
  2295. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  2296. @@ -13448,6 +13451,10 @@ openbsd*)
  2297. fi
  2298. ;;
  2299. +hyperbolabsd*)
  2300. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  2301. + ;;
  2302. +
  2303. osf3* | osf4* | osf5*)
  2304. lt_cv_deplibs_check_method=pass_all
  2305. ;;
  2306. @@ -16314,6 +16321,11 @@ _LT_EOF
  2307. fi
  2308. ;;
  2309. + hyperbolabsd*)
  2310. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  2311. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  2312. + ;;
  2313. +
  2314. solaris*)
  2315. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  2316. ld_shlibs=no
  2317. @@ -16900,6 +16912,18 @@ rm -f core conftest.err conftest.$ac_objext \
  2318. fi
  2319. ;;
  2320. + hyperbolabsd*)
  2321. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  2322. + hardcode_direct=yes
  2323. + hardcode_shlibpath_var=no
  2324. + hardcode_direct_absolute=yes
  2325. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  2326. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  2327. + else
  2328. + ld_shlibs=no
  2329. + fi
  2330. + ;;
  2331. +
  2332. os2*)
  2333. hardcode_libdir_flag_spec='-L$libdir'
  2334. hardcode_minus_L=yes
  2335. @@ -17887,6 +17911,16 @@ openbsd*)
  2336. fi
  2337. ;;
  2338. +hyperbolabsd*)
  2339. + version_type=sunos
  2340. + need_lib_prefix=no
  2341. + need_version=no
  2342. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2343. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2344. + shlibpath_var=LD_LIBRARY_PATH
  2345. + shlibpath_overrides_runpath=yes
  2346. + ;;
  2347. +
  2348. os2*)
  2349. libname_spec='$name'
  2350. shrext_cmds=".dll"
  2351. @@ -19865,6 +19899,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  2352. fi
  2353. ;;
  2354. + hyperbolabsd*)
  2355. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  2356. + hardcode_direct_CXX=yes
  2357. + hardcode_shlibpath_var_CXX=no
  2358. + hardcode_direct_absolute_CXX=yes
  2359. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  2360. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  2361. + else
  2362. + ld_shlibs_CXX=no
  2363. + fi
  2364. + ;;
  2365. +
  2366. osf3* | osf4* | osf5*)
  2367. case $cc_basename in
  2368. KCC*)
  2369. @@ -20563,7 +20609,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  2370. ;;
  2371. esac
  2372. ;;
  2373. - netbsd*)
  2374. + netbsd* | hyperbolabsd*)
  2375. ;;
  2376. *qnx* | *nto*)
  2377. # QNX uses GNU C++, but need to define -shared option too, otherwise
  2378. @@ -21547,6 +21593,16 @@ openbsd*)
  2379. fi
  2380. ;;
  2381. +hyperbolabsd*)
  2382. + version_type=sunos
  2383. + need_lib_prefix=no
  2384. + need_version=no
  2385. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2386. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2387. + shlibpath_var=LD_LIBRARY_PATH
  2388. + shlibpath_overrides_runpath=yes
  2389. + ;;
  2390. +
  2391. os2*)
  2392. libname_spec='$name'
  2393. shrext_cmds=".dll"
  2394. diff --git a/gcc/doc/g++.1 b/gcc/doc/g++.1
  2395. index 14efb7e..7f2c7a7 100644
  2396. --- a/gcc/doc/g++.1
  2397. +++ b/gcc/doc/g++.1
  2398. @@ -1089,7 +1089,7 @@ See \s-1RS/6000\s0 and PowerPC Options.
  2399. \&\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR
  2400. \&\fB\-minsert\-sched\-nops=\fR\fIscheme\fR
  2401. \&\fB\-mcall\-aixdesc \-mcall\-eabi \-mcall\-freebsd
  2402. -\&\-mcall\-linux \-mcall\-netbsd \-mcall\-openbsd
  2403. +\&\-mcall\-linux \-mcall\-netbsd \-mcall\-openbsd \-mcall\-hyperbolabsd
  2404. \&\-mcall\-sysv \-mcall\-sysv\-eabi \-mcall\-sysv\-noeabi
  2405. \&\-mtraceback=\fR\fItraceback_type\fR
  2406. \&\fB\-maix\-struct\-return \-msvr4\-struct\-return
  2407. @@ -21871,6 +21871,10 @@ NetBSD operating system.
  2408. .IX Item "-mcall-openbsd"
  2409. On System V.4 and embedded PowerPC systems compile code for the
  2410. OpenBSD operating system.
  2411. +.IP "\fB\-mcall\-hyperbolabsd\fR" 4
  2412. +.IX Item "-mcall-hyperbolabsd"
  2413. +On System V.4 and embedded PowerPC systems compile code for the
  2414. +HyperbolaBSD operating system.
  2415. .IP "\fB\-maix\-struct\-return\fR" 4
  2416. .IX Item "-maix-struct-return"
  2417. Return all structures in memory (as specified by the \s-1AIX ABI\s0).
  2418. @@ -23192,6 +23196,10 @@ NetBSD operating system.
  2419. .IX Item "-mcall-openbsd"
  2420. On System V.4 and embedded PowerPC systems compile code for the
  2421. OpenBSD operating system.
  2422. +.IP "\fB\-mcall\-hyperbolabsd\fR" 4
  2423. +.IX Item "-mcall-hyperbolabsd"
  2424. +On System V.4 and embedded PowerPC systems compile code for the
  2425. +HyperbolaBSD operating system.
  2426. .IP "\fB\-mtraceback=\fR\fItraceback_type\fR" 4
  2427. .IX Item "-mtraceback=traceback_type"
  2428. Select the type of traceback table. Valid values for \fItraceback_type\fR
  2429. @@ -26068,9 +26076,9 @@ in ordinary \s-1CPU\s0 registers instead.
  2430. Some 387 emulators do not support the \f(CW\*(C`sin\*(C'\fR, \f(CW\*(C`cos\*(C'\fR and
  2431. \&\f(CW\*(C`sqrt\*(C'\fR instructions for the 387. Specify this option to avoid
  2432. generating those instructions. This option is the default on
  2433. -OpenBSD and NetBSD. This option is overridden when \fB\-march\fR
  2434. -indicates that the target \s-1CPU\s0 always has an \s-1FPU\s0 and so the
  2435. -instruction does not need emulation. These
  2436. +HyperbolaBSD, OpenBSD and NetBSD. This option is overridden when
  2437. +\fB\-march\fR indicates that the target \s-1CPU\s0 always has an \s-1FPU\s0 and
  2438. +so the instruction does not need emulation. These
  2439. instructions are not generated unless you also use the
  2440. \&\fB\-funsafe\-math\-optimizations\fR switch.
  2441. .IP "\fB\-malign\-double\fR" 4
  2442. @@ -27533,6 +27541,9 @@ for contributors to \s-1GCC.\s0
  2443. .IX Header "COPYRIGHT"
  2444. Copyright (c) 1988\-2018 Free Software Foundation, Inc.
  2445. .PP
  2446. +Modifications to support HyperbolaBSD:
  2447. +Copyright (C) 2020\-2024 Hyperbola Project
  2448. +.PP
  2449. Permission is granted to copy, distribute and/or modify this document
  2450. under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
  2451. any later version published by the Free Software Foundation; with the
  2452. diff --git a/gcc/doc/gcc.1 b/gcc/doc/gcc.1
  2453. index 14efb7e..0de6e70 100644
  2454. --- a/gcc/doc/gcc.1
  2455. +++ b/gcc/doc/gcc.1
  2456. @@ -27533,6 +27533,9 @@ for contributors to \s-1GCC.\s0
  2457. .IX Header "COPYRIGHT"
  2458. Copyright (c) 1988\-2018 Free Software Foundation, Inc.
  2459. .PP
  2460. +Modifications to support HyperbolaBSD:
  2461. +Copyright (C) 2020\-2024 Hyperbola Project
  2462. +.PP
  2463. Permission is granted to copy, distribute and/or modify this document
  2464. under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
  2465. any later version published by the Free Software Foundation; with the
  2466. diff --git a/gcc/doc/gcc.info b/gcc/doc/gcc.info
  2467. index ccf781f..cff5b93 100644
  2468. --- a/gcc/doc/gcc.info
  2469. +++ b/gcc/doc/gcc.info
  2470. @@ -2,6 +2,9 @@ This is gcc.info, produced by makeinfo version 6.7 from gcc.texi.
  2471. Copyright (C) 1988-2018 Free Software Foundation, Inc.
  2472. +Modifications to support HyperbolaBSD:
  2473. +Copyright (C) 2020-2024 Hyperbola Project
  2474. +
  2475. Permission is granted to copy, distribute and/or modify this document
  2476. under the terms of the GNU Free Documentation License, Version 1.3 or
  2477. any later version published by the Free Software Foundation; with the
  2478. @@ -1391,7 +1394,7 @@ _Machine-Dependent Options_
  2479. -msched-costly-dep=DEPENDENCE_TYPE
  2480. -minsert-sched-nops=SCHEME
  2481. -mcall-aixdesc -mcall-eabi -mcall-freebsd
  2482. - -mcall-linux -mcall-netbsd -mcall-openbsd
  2483. + -mcall-linux -mcall-netbsd -mcall-openbsd -mcall-hyperbolabsd
  2484. -mcall-sysv -mcall-sysv-eabi -mcall-sysv-noeabi
  2485. -mtraceback=TRACEBACK_TYPE
  2486. -maix-struct-return -msvr4-struct-return
  2487. @@ -20965,6 +20968,10 @@ These '-m' options are defined for PowerPC SPE:
  2488. On System V.4 and embedded PowerPC systems compile code for the
  2489. OpenBSD operating system.
  2490. +'-mcall-hyperbolabsd'
  2491. + On System V.4 and embedded PowerPC systems compile code for the
  2492. + HyperbolaBSD operating system.
  2493. +
  2494. '-maix-struct-return'
  2495. Return all structures in memory (as specified by the AIX ABI).
  2496. @@ -22073,6 +22080,10 @@ These '-m' options are defined for the IBM RS/6000 and PowerPC:
  2497. On System V.4 and embedded PowerPC systems compile code for the
  2498. OpenBSD operating system.
  2499. +'-mcall-hyperbolabsd'
  2500. + On System V.4 and embedded PowerPC systems compile code for the
  2501. + HyperbolaBSD operating system.
  2502. +
  2503. '-mtraceback=TRACEBACK_TYPE'
  2504. Select the type of traceback table. Valid values for
  2505. TRACEBACK_TYPE are 'full', 'part', and 'no'.
  2506. @@ -24702,11 +24713,12 @@ These '-m' options are defined for the x86 family of computers.
  2507. '-mno-fancy-math-387'
  2508. Some 387 emulators do not support the 'sin', 'cos' and 'sqrt'
  2509. instructions for the 387. Specify this option to avoid generating
  2510. - those instructions. This option is the default on OpenBSD and
  2511. - NetBSD. This option is overridden when '-march' indicates that the
  2512. - target CPU always has an FPU and so the instruction does not need
  2513. - emulation. These instructions are not generated unless you also
  2514. - use the '-funsafe-math-optimizations' switch.
  2515. + those instructions. This option is the default on HyperbolaBSD,
  2516. + OpenBSD and NetBSD. This option is overridden when '-march'
  2517. + indicates that the target CPU always has an FPU and so the
  2518. + instruction does not need emulation. These instructions are not
  2519. + generated unless you also use the '-funsafe-math-optimizations'
  2520. + switch.
  2521. '-malign-double'
  2522. '-mno-align-double'
  2523. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
  2524. index 78ca773..47d02b4 100644
  2525. --- a/gcc/doc/invoke.texi
  2526. +++ b/gcc/doc/invoke.texi
  2527. @@ -1,4 +1,8 @@
  2528. @c Copyright (C) 1988-2018 Free Software Foundation, Inc.
  2529. +
  2530. +@c Modifications to support HyperbolaBSD:
  2531. +@c Copyright (C) 2020-2024 Hyperbola Project
  2532. +
  2533. @c This is part of the GCC manual.
  2534. @c For copying conditions, see the file gcc.texi.
  2535. @@ -10,6 +14,9 @@
  2536. @c man begin COPYRIGHT
  2537. Copyright @copyright{} 1988-2018 Free Software Foundation, Inc.
  2538. +Modifications to support HyperbolaBSD:
  2539. +Copyright @copyright{} 2020-2024 Hyperbola Project
  2540. +
  2541. Permission is granted to copy, distribute and/or modify this document
  2542. under the terms of the GNU Free Documentation License, Version 1.3 or
  2543. any later version published by the Free Software Foundation; with the
  2544. @@ -1077,7 +1084,7 @@ See RS/6000 and PowerPC Options.
  2545. -msched-costly-dep=@var{dependence_type} @gol
  2546. -minsert-sched-nops=@var{scheme} @gol
  2547. -mcall-aixdesc -mcall-eabi -mcall-freebsd @gol
  2548. --mcall-linux -mcall-netbsd -mcall-openbsd @gol
  2549. +-mcall-linux -mcall-netbsd -mcall-openbsd -mcall-hyperbolabsd @gol
  2550. -mcall-sysv -mcall-sysv-eabi -mcall-sysv-noeabi @gol
  2551. -mtraceback=@var{traceback_type} @gol
  2552. -maix-struct-return -msvr4-struct-return @gol
  2553. @@ -22707,10 +22714,15 @@ On System V.4 and embedded PowerPC systems compile code for the
  2554. NetBSD operating system.
  2555. @item -mcall-openbsd
  2556. -@opindex mcall-netbsd
  2557. +@opindex mcall-openbsd
  2558. On System V.4 and embedded PowerPC systems compile code for the
  2559. OpenBSD operating system.
  2560. +@item -mcall-hyperbolabsd
  2561. +@opindex mcall-hyperbolabsd
  2562. +On System V.4 and embedded PowerPC systems compile code for the
  2563. +HyperbolaBSD operating system.
  2564. +
  2565. @item -maix-struct-return
  2566. @opindex maix-struct-return
  2567. Return all structures in memory (as specified by the AIX ABI)@.
  2568. @@ -24015,10 +24027,15 @@ On System V.4 and embedded PowerPC systems compile code for the
  2569. NetBSD operating system.
  2570. @item -mcall-openbsd
  2571. -@opindex mcall-netbsd
  2572. +@opindex mcall-openbsd
  2573. On System V.4 and embedded PowerPC systems compile code for the
  2574. OpenBSD operating system.
  2575. +@item -mcall-hyperbolabsd
  2576. +@opindex mcall-hyperbolabsd
  2577. +On System V.4 and embedded PowerPC systems compile code for the
  2578. +HyperbolaBSD operating system.
  2579. +
  2580. @item -mtraceback=@var{traceback_type}
  2581. @opindex mtraceback
  2582. Select the type of traceback table. Valid values for @var{traceback_type}
  2583. @@ -26985,9 +27002,9 @@ in ordinary CPU registers instead.
  2584. Some 387 emulators do not support the @code{sin}, @code{cos} and
  2585. @code{sqrt} instructions for the 387. Specify this option to avoid
  2586. generating those instructions. This option is the default on
  2587. -OpenBSD and NetBSD@. This option is overridden when @option{-march}
  2588. -indicates that the target CPU always has an FPU and so the
  2589. -instruction does not need emulation. These
  2590. +HyperbolaBSD, OpenBSD and NetBSD@. This option is overridden when
  2591. +@option{-march} indicates that the target CPU always has an FPU and
  2592. +so the instruction does not need emulation. These
  2593. instructions are not generated unless you also use the
  2594. @option{-funsafe-math-optimizations} switch.
  2595. diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
  2596. index 31b96a7..2d004de 100644
  2597. --- a/gcc/ginclude/stddef.h
  2598. +++ b/gcc/ginclude/stddef.h
  2599. @@ -1,5 +1,8 @@
  2600. /* Copyright (C) 1989-2018 Free Software Foundation, Inc.
  2601. + Modifications to support HyperbolaBSD:
  2602. + Copyright (C) 2020-2024 Hyperbola Project
  2603. +
  2604. This file is part of GCC.
  2605. GCC is free software; you can redistribute it and/or modify
  2606. @@ -52,7 +55,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  2607. #include <machine/ansi.h>
  2608. #endif
  2609. /* On FreeBSD 5, machine/ansi.h does not exist anymore... */
  2610. -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
  2611. +#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) || defined (__HyperbolaBSD__)
  2612. #include <sys/_types.h>
  2613. #endif
  2614. @@ -201,6 +204,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
  2615. #define _GCC_SIZE_T
  2616. #define _SIZET_
  2617. #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
  2618. + || defined(__HyperbolaBSD__) \
  2619. || defined(__DragonFly__) \
  2620. || defined(__FreeBSD_kernel__)
  2621. /* __size_t is a typedef on FreeBSD 5, must not trash it. */
  2622. diff --git a/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc/testsuite/gcc.dg/cpp/assert4.c
  2623. index 92e3dba..51ca15b 100644
  2624. --- a/gcc/testsuite/gcc.dg/cpp/assert4.c
  2625. +++ b/gcc/testsuite/gcc.dg/cpp/assert4.c
  2626. @@ -1,6 +1,9 @@
  2627. /* Copyright (C) 2003, 2006, 2008, 2009, 2011, 2012
  2628. Free Software Foundation, Inc.
  2629. + Modifications to support HyperbolaBSD:
  2630. + Copyright (C) 2020-2024 Hyperbola Project
  2631. +
  2632. Test builtin preprocessor assertions.
  2633. By Kaveh Ghazi <ghazi@caip.rutgers.edu>. */
  2634. @@ -49,6 +52,14 @@
  2635. # error
  2636. #endif
  2637. +#if defined __HyperbolaBSD__
  2638. +# if !#system(HyperbolaBSD) || !#system(unix) || !#system(bsd)
  2639. +# error
  2640. +# endif
  2641. +#elif #system(HyperbolaBSD)
  2642. +# error
  2643. +#endif
  2644. +
  2645. #if defined __svr4__ || defined __SYSTYPE_SVR4__
  2646. # if !#system(svr4) || !#system(unix)
  2647. # error
  2648. diff --git a/include/libiberty.h b/include/libiberty.h
  2649. index dc09e79..7049083 100644
  2650. --- a/include/libiberty.h
  2651. +++ b/include/libiberty.h
  2652. @@ -1,6 +1,9 @@
  2653. /* Function declarations for libiberty.
  2654. Copyright (C) 1997-2018 Free Software Foundation, Inc.
  2655. +
  2656. + Modifications to support HyperbolaBSD:
  2657. + Copyright (C) 2020-2024 Hyperbola Project
  2658. Note - certain prototypes declared in this header file are for
  2659. functions whoes implementation copyright does not belong to the
  2660. @@ -106,7 +109,8 @@ extern int countargv (char * const *);
  2661. is 1, we found it so don't provide any declaration at all. */
  2662. #if !HAVE_DECL_BASENAME
  2663. #if defined (__GNU_LIBRARY__ ) || defined (__linux__) \
  2664. - || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) \
  2665. + || defined (__FreeBSD__) || defined (__HyperbolaBSD__) \
  2666. + || defined (__OpenBSD__) || defined (__NetBSD__) \
  2667. || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) \
  2668. || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME)
  2669. extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
  2670. diff --git a/libatomic/configure b/libatomic/configure
  2671. index b902e2c..9749f76 100755
  2672. --- a/libatomic/configure
  2673. +++ b/libatomic/configure
  2674. @@ -6,6 +6,9 @@
  2675. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  2676. # Foundation, Inc.
  2677. #
  2678. +# Modifications to support HyperbolaBSD:
  2679. +# Copyright (C) 2020-2024 Hyperbola Project
  2680. +#
  2681. # This configure script is free software; the Free Software Foundation
  2682. # gives unlimited permission to copy, distribute and modify it.
  2683. ## -------------------- ##
  2684. @@ -5411,7 +5414,7 @@ else
  2685. lt_cv_sys_max_cmd_len=8192;
  2686. ;;
  2687. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  2688. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  2689. # This has been around since 386BSD, at least. Likely further.
  2690. if test -x /sbin/sysctl; then
  2691. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  2692. @@ -5849,6 +5852,10 @@ openbsd*)
  2693. fi
  2694. ;;
  2695. +hyperbolabsd*)
  2696. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  2697. + ;;
  2698. +
  2699. osf3* | osf4* | osf5*)
  2700. lt_cv_deplibs_check_method=pass_all
  2701. ;;
  2702. @@ -8985,6 +8992,11 @@ _LT_EOF
  2703. fi
  2704. ;;
  2705. + hyperbolabsd*)
  2706. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  2707. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  2708. + ;;
  2709. +
  2710. solaris*)
  2711. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  2712. ld_shlibs=no
  2713. @@ -9571,6 +9583,18 @@ rm -f core conftest.err conftest.$ac_objext \
  2714. fi
  2715. ;;
  2716. + hyperbolabsd*)
  2717. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  2718. + hardcode_direct=yes
  2719. + hardcode_shlibpath_var=no
  2720. + hardcode_direct_absolute=yes
  2721. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  2722. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  2723. + else
  2724. + ld_shlibs=no
  2725. + fi
  2726. + ;;
  2727. +
  2728. os2*)
  2729. hardcode_libdir_flag_spec='-L$libdir'
  2730. hardcode_minus_L=yes
  2731. @@ -10558,6 +10582,16 @@ openbsd*)
  2732. fi
  2733. ;;
  2734. +hyperbolabsd*)
  2735. + version_type=sunos
  2736. + need_lib_prefix=no
  2737. + need_version=no
  2738. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2739. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2740. + shlibpath_var=LD_LIBRARY_PATH
  2741. + shlibpath_overrides_runpath=yes
  2742. + ;;
  2743. +
  2744. os2*)
  2745. libname_spec='$name'
  2746. shrext_cmds=".dll"
  2747. diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
  2748. index ea8c34f..2890cf0 100644
  2749. --- a/libatomic/configure.tgt
  2750. +++ b/libatomic/configure.tgt
  2751. @@ -2,6 +2,9 @@
  2752. # Copyright (C) 2012-2018 Free Software Foundation, Inc.
  2753. # Contributed by Richard Henderson <rth@redhat.com>.
  2754. #
  2755. +# Modifications to support HyperbolaBSD:
  2756. +# Copyright (C) 2020-2024 Hyperbola Project
  2757. +#
  2758. # This file is part of the GNU Atomic Library (libatomic).
  2759. #
  2760. # Libatomic is free software; you can redistribute it and/or modify it
  2761. @@ -135,7 +138,7 @@ case "${target}" in
  2762. ;;
  2763. *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
  2764. - | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \
  2765. + | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* | *-*-hyperbolabsd \
  2766. | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
  2767. | *-*-darwin* | *-*-aix* | *-*-cygwin*)
  2768. # POSIX system. The OS is supported.
  2769. diff --git a/libbacktrace/configure b/libbacktrace/configure
  2770. index 87cadda..91af34e 100755
  2771. --- a/libbacktrace/configure
  2772. +++ b/libbacktrace/configure
  2773. @@ -6,6 +6,9 @@
  2774. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  2775. # Foundation, Inc.
  2776. #
  2777. +# Modifications to support HyperbolaBSD:
  2778. +# Copyright (C) 2020-2024 Hyperbola Project
  2779. +#
  2780. # This configure script is free software; the Free Software Foundation
  2781. # gives unlimited permission to copy, distribute and modify it.
  2782. ## -------------------- ##
  2783. @@ -5708,7 +5711,7 @@ else
  2784. lt_cv_sys_max_cmd_len=8192;
  2785. ;;
  2786. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  2787. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  2788. # This has been around since 386BSD, at least. Likely further.
  2789. if test -x /sbin/sysctl; then
  2790. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  2791. @@ -6146,6 +6149,10 @@ openbsd*)
  2792. fi
  2793. ;;
  2794. +hyperbolabsd*)
  2795. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  2796. + ;;
  2797. +
  2798. osf3* | osf4* | osf5*)
  2799. lt_cv_deplibs_check_method=pass_all
  2800. ;;
  2801. @@ -9013,6 +9020,11 @@ _LT_EOF
  2802. fi
  2803. ;;
  2804. + hyperbolabsd*)
  2805. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  2806. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  2807. + ;;
  2808. +
  2809. solaris*)
  2810. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  2811. ld_shlibs=no
  2812. @@ -9599,6 +9611,18 @@ rm -f core conftest.err conftest.$ac_objext \
  2813. fi
  2814. ;;
  2815. + hyperbolabsd*)
  2816. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  2817. + hardcode_direct=yes
  2818. + hardcode_shlibpath_var=no
  2819. + hardcode_direct_absolute=yes
  2820. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  2821. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  2822. + else
  2823. + ld_shlibs=no
  2824. + fi
  2825. + ;;
  2826. +
  2827. os2*)
  2828. hardcode_libdir_flag_spec='-L$libdir'
  2829. hardcode_minus_L=yes
  2830. @@ -10586,6 +10610,16 @@ openbsd*)
  2831. fi
  2832. ;;
  2833. +hyperbolabsd*)
  2834. + version_type=sunos
  2835. + need_lib_prefix=no
  2836. + need_version=no
  2837. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2838. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2839. + shlibpath_var=LD_LIBRARY_PATH
  2840. + shlibpath_overrides_runpath=yes
  2841. + ;;
  2842. +
  2843. os2*)
  2844. libname_spec='$name'
  2845. shrext_cmds=".dll"
  2846. diff --git a/libcc1/configure b/libcc1/configure
  2847. index f53a121..cd29d82 100755
  2848. --- a/libcc1/configure
  2849. +++ b/libcc1/configure
  2850. @@ -6,6 +6,9 @@
  2851. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  2852. # Foundation, Inc.
  2853. #
  2854. +# Modifications to support HyperbolaBSD:
  2855. +# Copyright (C) 2020-2024 Hyperbola Project
  2856. +#
  2857. # This configure script is free software; the Free Software Foundation
  2858. # gives unlimited permission to copy, distribute and modify it.
  2859. ## -------------------- ##
  2860. @@ -5105,7 +5108,7 @@ else
  2861. lt_cv_sys_max_cmd_len=8192;
  2862. ;;
  2863. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  2864. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  2865. # This has been around since 386BSD, at least. Likely further.
  2866. if test -x /sbin/sysctl; then
  2867. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  2868. @@ -5543,6 +5546,10 @@ openbsd*)
  2869. fi
  2870. ;;
  2871. +hyperbolabsd*)
  2872. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  2873. + ;;
  2874. +
  2875. osf3* | osf4* | osf5*)
  2876. lt_cv_deplibs_check_method=pass_all
  2877. ;;
  2878. @@ -8409,6 +8416,11 @@ _LT_EOF
  2879. fi
  2880. ;;
  2881. + hyperbolabsd*)
  2882. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  2883. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  2884. + ;;
  2885. +
  2886. solaris*)
  2887. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  2888. ld_shlibs=no
  2889. @@ -8995,6 +9007,18 @@ rm -f core conftest.err conftest.$ac_objext \
  2890. fi
  2891. ;;
  2892. + hyperbolabsd*)
  2893. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  2894. + hardcode_direct=yes
  2895. + hardcode_shlibpath_var=no
  2896. + hardcode_direct_absolute=yes
  2897. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  2898. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  2899. + else
  2900. + ld_shlibs=no
  2901. + fi
  2902. + ;;
  2903. +
  2904. os2*)
  2905. hardcode_libdir_flag_spec='-L$libdir'
  2906. hardcode_minus_L=yes
  2907. @@ -9982,6 +10006,16 @@ openbsd*)
  2908. fi
  2909. ;;
  2910. +hyperbolabsd*)
  2911. + version_type=sunos
  2912. + need_lib_prefix=no
  2913. + need_version=no
  2914. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2915. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2916. + shlibpath_var=LD_LIBRARY_PATH
  2917. + shlibpath_overrides_runpath=yes
  2918. + ;;
  2919. +
  2920. os2*)
  2921. libname_spec='$name'
  2922. shrext_cmds=".dll"
  2923. @@ -12366,6 +12400,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  2924. fi
  2925. ;;
  2926. + hyperbolabsd*)
  2927. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  2928. + hardcode_direct_CXX=yes
  2929. + hardcode_shlibpath_var_CXX=no
  2930. + hardcode_direct_absolute_CXX=yes
  2931. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  2932. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  2933. + else
  2934. + ld_shlibs_CXX=no
  2935. + fi
  2936. + ;;
  2937. +
  2938. osf3* | osf4* | osf5*)
  2939. case $cc_basename in
  2940. KCC*)
  2941. @@ -13064,7 +13110,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  2942. ;;
  2943. esac
  2944. ;;
  2945. - netbsd*)
  2946. + netbsd* | hyperbolabsd*)
  2947. ;;
  2948. *qnx* | *nto*)
  2949. # QNX uses GNU C++, but need to define -shared option too, otherwise
  2950. @@ -14048,6 +14094,16 @@ openbsd*)
  2951. fi
  2952. ;;
  2953. +hyperbolabsd*)
  2954. + version_type=sunos
  2955. + need_lib_prefix=no
  2956. + need_version=no
  2957. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2958. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2959. + shlibpath_var=LD_LIBRARY_PATH
  2960. + shlibpath_overrides_runpath=yes
  2961. + ;;
  2962. +
  2963. os2*)
  2964. libname_spec='$name'
  2965. shrext_cmds=".dll"
  2966. diff --git a/libffi/README b/libffi/README
  2967. index c072101..7282589 100644
  2968. --- a/libffi/README
  2969. +++ b/libffi/README
  2970. @@ -101,6 +101,7 @@ tested:
  2971. | X86 | Linux | GCC |
  2972. | X86 | Mac OSX | GCC |
  2973. | X86 | OpenBSD | GCC |
  2974. +| X86 | HyperbolaBSD | GCC |
  2975. | X86 | OS/2 | GCC |
  2976. | X86 | Solaris | GCC |
  2977. | X86 | Solaris | Oracle Solaris Studio C |
  2978. @@ -110,6 +111,7 @@ tested:
  2979. | X86-64 | Linux | GCC |
  2980. | X86-64 | Linux/x32 | GCC |
  2981. | X86-64 | OpenBSD | GCC |
  2982. +| X86-64 | HyperbolaBSD | GCC |
  2983. | X86-64 | Solaris | Oracle Solaris Studio C |
  2984. | X86-64 | Windows/Cygwin | GCC |
  2985. | X86-64 | Windows/MingW | GCC |
  2986. diff --git a/libffi/configure b/libffi/configure
  2987. index 790a291..1691544 100755
  2988. --- a/libffi/configure
  2989. +++ b/libffi/configure
  2990. @@ -8,6 +8,9 @@
  2991. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  2992. # Foundation, Inc.
  2993. #
  2994. +# Modifications to support HyperbolaBSD:
  2995. +# Copyright (C) 2020-2024 Hyperbola Project
  2996. +#
  2997. # This configure script is free software; the Free Software Foundation
  2998. # gives unlimited permission to copy, distribute and modify it.
  2999. ## -------------------- ##
  3000. @@ -5680,7 +5683,7 @@ else
  3001. lt_cv_sys_max_cmd_len=8192;
  3002. ;;
  3003. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  3004. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  3005. # This has been around since 386BSD, at least. Likely further.
  3006. if test -x /sbin/sysctl; then
  3007. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  3008. @@ -6118,6 +6121,10 @@ openbsd*)
  3009. fi
  3010. ;;
  3011. +hyperbolabsd*)
  3012. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  3013. + ;;
  3014. +
  3015. osf3* | osf4* | osf5*)
  3016. lt_cv_deplibs_check_method=pass_all
  3017. ;;
  3018. @@ -9255,6 +9262,11 @@ _LT_EOF
  3019. fi
  3020. ;;
  3021. + hyperbolabsd*)
  3022. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  3023. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  3024. + ;;
  3025. +
  3026. solaris*)
  3027. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  3028. ld_shlibs=no
  3029. @@ -9841,6 +9853,18 @@ rm -f core conftest.err conftest.$ac_objext \
  3030. fi
  3031. ;;
  3032. + hyperbolabsd*)
  3033. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3034. + hardcode_direct=yes
  3035. + hardcode_shlibpath_var=no
  3036. + hardcode_direct_absolute=yes
  3037. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3038. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  3039. + else
  3040. + ld_shlibs=no
  3041. + fi
  3042. + ;;
  3043. +
  3044. os2*)
  3045. hardcode_libdir_flag_spec='-L$libdir'
  3046. hardcode_minus_L=yes
  3047. @@ -10828,6 +10852,16 @@ openbsd*)
  3048. fi
  3049. ;;
  3050. +hyperbolabsd*)
  3051. + version_type=sunos
  3052. + need_lib_prefix=no
  3053. + need_version=no
  3054. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  3055. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  3056. + shlibpath_var=LD_LIBRARY_PATH
  3057. + shlibpath_overrides_runpath=yes
  3058. + ;;
  3059. +
  3060. os2*)
  3061. libname_spec='$name'
  3062. shrext_cmds=".dll"
  3063. @@ -12806,6 +12840,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  3064. fi
  3065. ;;
  3066. + hyperbolabsd*)
  3067. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3068. + hardcode_direct_CXX=yes
  3069. + hardcode_shlibpath_var_CXX=no
  3070. + hardcode_direct_absolute_CXX=yes
  3071. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3072. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  3073. + else
  3074. + ld_shlibs_CXX=no
  3075. + fi
  3076. + ;;
  3077. +
  3078. osf3* | osf4* | osf5*)
  3079. case $cc_basename in
  3080. KCC*)
  3081. @@ -13504,7 +13550,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  3082. ;;
  3083. esac
  3084. ;;
  3085. - netbsd*)
  3086. + netbsd* | hyperbolabsd*)
  3087. ;;
  3088. *qnx* | *nto*)
  3089. # QNX uses GNU C++, but need to define -shared option too, otherwise
  3090. @@ -14488,6 +14534,16 @@ openbsd*)
  3091. fi
  3092. ;;
  3093. +hyperbolabsd*)
  3094. + version_type=sunos
  3095. + need_lib_prefix=no
  3096. + need_version=no
  3097. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  3098. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  3099. + shlibpath_var=LD_LIBRARY_PATH
  3100. + shlibpath_overrides_runpath=yes
  3101. + ;;
  3102. +
  3103. os2*)
  3104. libname_spec='$name'
  3105. shrext_cmds=".dll"
  3106. @@ -15808,7 +15864,7 @@ case "$target" in
  3107. $as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h
  3108. ;;
  3109. - *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
  3110. + *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-*-hyperbolabsd*)
  3111. $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
  3112. diff --git a/libffi/configure.ac b/libffi/configure.ac
  3113. index a01d8ac..c8bc716 100644
  3114. --- a/libffi/configure.ac
  3115. +++ b/libffi/configure.ac
  3116. @@ -193,7 +193,7 @@ case "$target" in
  3117. [Cannot use PROT_EXEC on this target, so, we revert to
  3118. alternative means])
  3119. ;;
  3120. - *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
  3121. + *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-*-hyperbolabsd*)
  3122. AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
  3123. [Cannot use malloc on this target, so, we revert to
  3124. alternative means])
  3125. diff --git a/libffi/configure.host b/libffi/configure.host
  3126. index 24fbfc4..6e87357 100644
  3127. --- a/libffi/configure.host
  3128. +++ b/libffi/configure.host
  3129. @@ -64,6 +64,10 @@ case "${host}" in
  3130. TARGET=X86_FREEBSD; TARGETDIR=x86
  3131. ;;
  3132. + i?86-*-hyperbolabsd*)
  3133. + TARGET=X86_HYPERBOLABSD; TARGETDIR=x86
  3134. + ;;
  3135. +
  3136. i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
  3137. | x86_64-*-cygwin* | x86_64-*-mingw*)
  3138. TARGETDIR=x86
  3139. @@ -188,6 +192,10 @@ case "${host}" in
  3140. TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
  3141. HAVE_LONG_DOUBLE_VARIANT=1
  3142. ;;
  3143. + powerpc-*-hyperbolabsd*)
  3144. + TARGET=POWER_HYPERBOLABSD; TARGETDIR=powerpc
  3145. + HAVE_LONG_DOUBLE_VARIANT=1
  3146. + ;;
  3147. powerpc64-*-freebsd*)
  3148. TARGET=POWERPC; TARGETDIR=powerpc
  3149. ;;
  3150. diff --git a/libffi/src/dlmalloc.c b/libffi/src/dlmalloc.c
  3151. index 7e4ea83..886dd6b 100644
  3152. --- a/libffi/src/dlmalloc.c
  3153. +++ b/libffi/src/dlmalloc.c
  3154. @@ -1195,7 +1195,8 @@ int mspace_mallopt(int, int);
  3155. #ifndef LACKS_UNISTD_H
  3156. #include <unistd.h> /* for sbrk */
  3157. #else /* LACKS_UNISTD_H */
  3158. -#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
  3159. +#if !defined(__FreeBSD__) && !defined(__HyperbolaBSD__) \
  3160. + && !defined(__OpenBSD__) && !defined(__NetBSD__)
  3161. extern void* sbrk(ptrdiff_t);
  3162. #endif /* FreeBSD etc */
  3163. #endif /* LACKS_UNISTD_H */
  3164. diff --git a/libffi/src/powerpc/ffitarget.h b/libffi/src/powerpc/ffitarget.h
  3165. index 90aa36b..7201411 100644
  3166. --- a/libffi/src/powerpc/ffitarget.h
  3167. +++ b/libffi/src/powerpc/ffitarget.h
  3168. @@ -3,6 +3,9 @@
  3169. Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc
  3170. Copyright (c) 1996-2003 Red Hat, Inc.
  3171. + Modifications to support HyperbolaBSD:
  3172. + Copyright (C) 2024 Hyperbola Project
  3173. +
  3174. Target configuration macros for PowerPC.
  3175. Permission is hereby granted, free of charge, to any person obtaining
  3176. @@ -116,7 +119,7 @@ typedef enum ffi_abi {
  3177. | FFI_SYSV_SOFT_FLOAT
  3178. # endif
  3179. # if (defined (__SVR4_STRUCT_RETURN) \
  3180. - || defined (POWERPC_FREEBSD) && !defined (__AIX_STRUCT_RETURN))
  3181. + || (defined (POWERPC_FREEBSD) || defined (POWER_HYPERBOLABSD)) && !defined (__AIX_STRUCT_RETURN))
  3182. | FFI_SYSV_STRUCT_RET
  3183. # endif
  3184. # if __LDBL_MANT_DIG__ == 106
  3185. @@ -137,7 +140,7 @@ typedef enum ffi_abi {
  3186. #define FFI_CLOSURES 1
  3187. #define FFI_NATIVE_RAW_API 0
  3188. -#if defined (POWERPC) || defined (POWERPC_FREEBSD)
  3189. +#if defined (POWERPC) || defined (POWERPC_FREEBSD) || defined (POWER_HYPERBOLABSD)
  3190. # define FFI_GO_CLOSURES 1
  3191. # define FFI_TARGET_SPECIFIC_VARIADIC 1
  3192. # define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs
  3193. diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp
  3194. index a0f6ab3..5163273 100644
  3195. --- a/libffi/testsuite/lib/libffi.exp
  3196. +++ b/libffi/testsuite/lib/libffi.exp
  3197. @@ -1,5 +1,8 @@
  3198. # Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014 Free Software Foundation, Inc.
  3199. +# Modifications to support HyperbolaBSD:
  3200. +# Copyright (C) 2024 Hyperbola Project
  3201. +
  3202. # This program is free software; you can redistribute it and/or modify
  3203. # it under the terms of the GNU General Public License as published by
  3204. # the Free Software Foundation; either version 3 of the License, or
  3205. @@ -215,6 +218,10 @@ proc libffi_target_compile { source dest type options } {
  3206. lappend options "libs= -lpthread"
  3207. }
  3208. + if { [string match "*-*-hyperbolabsd*" $target_triplet] } {
  3209. + lappend options "libs= -lpthread"
  3210. + }
  3211. +
  3212. lappend options "libs= -lffi"
  3213. if { [string match "aarch64*-*-linux*" $target_triplet] } {
  3214. diff --git a/libgcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h
  3215. index 9f7d3f2..eed7c06 100644
  3216. --- a/libgcc/config/arm/unwind-arm.h
  3217. +++ b/libgcc/config/arm/unwind-arm.h
  3218. @@ -2,6 +2,9 @@
  3219. Copyright (C) 2003-2018 Free Software Foundation, Inc.
  3220. Contributed by Paul Brook
  3221. + Modifications to support HyperbolaBSD:
  3222. + Copyright (C) 2020-2024 Hyperbola Project
  3223. +
  3224. This file is free software; you can redistribute it and/or modify it
  3225. under the terms of the GNU General Public License as published by the
  3226. Free Software Foundation; either version 3, or (at your option) any
  3227. @@ -49,7 +52,7 @@ extern "C" {
  3228. return 0;
  3229. #if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \
  3230. - || defined(__FreeBSD__) || defined(__fuchsia__)
  3231. + || defined(__FreeBSD__) || defined(__fuchsia__) || defined(__HyperbolaBSD__)
  3232. /* Pc-relative indirect. */
  3233. #define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel | DW_EH_PE_indirect)
  3234. tmp += ptr;
  3235. diff --git b/libgcc/config/t-hyperbolabsd-thread b/libgcc/config/t-hyperbolabsd-thread
  3236. new file mode 100644
  3237. index 0000000..50b61e5
  3238. --- /dev/null
  3239. +++ b/libgcc/config/t-hyperbolabsd-thread
  3240. @@ -0,0 +1,3 @@
  3241. +# This is currently needed to compile libgcc2 for threads support
  3242. +HOST_LIBGCC2_CFLAGS += -pthread
  3243. +
  3244. diff --git a/libgcc/config.host b/libgcc/config.host
  3245. index 677173e..6bf48cc 100644
  3246. --- a/libgcc/config.host
  3247. +++ b/libgcc/config.host
  3248. @@ -1,6 +1,9 @@
  3249. # libgcc host-specific configuration file.
  3250. # Copyright (C) 1997-2018 Free Software Foundation, Inc.
  3251. +# Modifications to support HyperbolaBSD:
  3252. +# Copyright (C) 2020-2024 Hyperbola Project
  3253. +
  3254. #This file is part of GCC.
  3255. #GCC is free software; you can redistribute it and/or modify it under
  3256. @@ -260,6 +263,14 @@ case ${host} in
  3257. ;;
  3258. esac
  3259. ;;
  3260. +*-*-hyperbolabsd*)
  3261. + tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
  3262. + case ${target_thread_file} in
  3263. + posix)
  3264. + tmake_file="$tmake_file t-hyperbolabsd-thread"
  3265. + ;;
  3266. + esac
  3267. + ;;
  3268. *-*-rtems*)
  3269. tmake_file="$tmake_file t-rtems"
  3270. extra_parts="crtbegin.o crtend.o"
  3271. @@ -317,7 +328,8 @@ case ${host} in
  3272. esac
  3273. case ${host} in
  3274. -*-*-darwin* | *-*-dragonfly* | *-*-freebsd* | *-*-netbsd* | *-*-openbsd* | \
  3275. +*-*-darwin* | *-*-dragonfly* | *-*-freebsd* | \
  3276. + *-*-netbsd* | *-*-openbsd* | *-*-hyperbolabsd* | \
  3277. *-*-solaris2*)
  3278. enable_execute_stack=enable-execute-stack-mprotect.c
  3279. ;;
  3280. diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
  3281. index ce6a46c..3aba7f9 100644
  3282. --- a/libgcc/unwind-dw2-fde-dip.c
  3283. +++ b/libgcc/unwind-dw2-fde-dip.c
  3284. @@ -1,6 +1,9 @@
  3285. /* Copyright (C) 2001-2018 Free Software Foundation, Inc.
  3286. Contributed by Jakub Jelinek <jakub@redhat.com>.
  3287. + Modifications to support HyperbolaBSD:
  3288. + Copyright (C) 2020-2024 Hyperbola Project
  3289. +
  3290. This file is part of GCC.
  3291. GCC is free software; you can redistribute it and/or modify
  3292. @@ -32,7 +35,7 @@
  3293. #include "tconfig.h"
  3294. #include "tsystem.h"
  3295. -#if !defined(inhibit_libc) && !defined(__OpenBSD__)
  3296. +#if !defined(inhibit_libc) && !defined(__OpenBSD__) && !defined(__HyperbolaBSD__)
  3297. #include <elf.h> /* Get DT_CONFIG. */
  3298. #endif
  3299. #include "coretypes.h"
  3300. @@ -71,7 +74,7 @@
  3301. #endif
  3302. #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
  3303. - && (defined(__OpenBSD__) || defined(__NetBSD__))
  3304. + && (defined(__HyperbolaBSD__) || defined(__OpenBSD__) || defined(__NetBSD__))
  3305. # define ElfW(type) Elf_##type
  3306. # define USE_PT_GNU_EH_FRAME
  3307. #endif
  3308. diff --git a/libgfortran/configure b/libgfortran/configure
  3309. index 91fce8f..1a9710b 100755
  3310. --- a/libgfortran/configure
  3311. +++ b/libgfortran/configure
  3312. @@ -6,6 +6,9 @@
  3313. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  3314. # Foundation, Inc.
  3315. #
  3316. +# Modifications to support HyperbolaBSD:
  3317. +# Copyright (C) 2020-2024 Hyperbola Project
  3318. +#
  3319. # This configure script is free software; the Free Software Foundation
  3320. # gives unlimited permission to copy, distribute and modify it.
  3321. ## -------------------- ##
  3322. @@ -7041,7 +7044,7 @@ else
  3323. lt_cv_sys_max_cmd_len=8192;
  3324. ;;
  3325. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  3326. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  3327. # This has been around since 386BSD, at least. Likely further.
  3328. if test -x /sbin/sysctl; then
  3329. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  3330. @@ -7479,6 +7482,10 @@ openbsd*)
  3331. fi
  3332. ;;
  3333. +hyperbolabsd*)
  3334. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  3335. + ;;
  3336. +
  3337. osf3* | osf4* | osf5*)
  3338. lt_cv_deplibs_check_method=pass_all
  3339. ;;
  3340. @@ -10350,6 +10357,11 @@ _LT_EOF
  3341. fi
  3342. ;;
  3343. + hyperbolabsd*)
  3344. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  3345. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  3346. + ;;
  3347. +
  3348. solaris*)
  3349. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  3350. ld_shlibs=no
  3351. @@ -10945,6 +10957,18 @@ rm -f core conftest.err conftest.$ac_objext \
  3352. fi
  3353. ;;
  3354. + hyperbolabsd*)
  3355. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3356. + hardcode_direct=yes
  3357. + hardcode_shlibpath_var=no
  3358. + hardcode_direct_absolute=yes
  3359. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3360. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  3361. + else
  3362. + ld_shlibs=no
  3363. + fi
  3364. + ;;
  3365. +
  3366. os2*)
  3367. hardcode_libdir_flag_spec='-L$libdir'
  3368. hardcode_minus_L=yes
  3369. @@ -11935,6 +11959,16 @@ openbsd*)
  3370. fi
  3371. ;;
  3372. +hyperbolabsd*)
  3373. + version_type=sunos
  3374. + need_lib_prefix=no
  3375. + need_version=no
  3376. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  3377. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  3378. + shlibpath_var=LD_LIBRARY_PATH
  3379. + shlibpath_overrides_runpath=yes
  3380. + ;;
  3381. +
  3382. os2*)
  3383. libname_spec='$name'
  3384. shrext_cmds=".dll"
  3385. @@ -14199,6 +14233,11 @@ _LT_EOF
  3386. fi
  3387. ;;
  3388. + hyperbolabsd*)
  3389. + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  3390. + archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  3391. + ;;
  3392. +
  3393. solaris*)
  3394. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  3395. ld_shlibs_FC=no
  3396. @@ -14742,6 +14781,18 @@ rm -f core conftest.err conftest.$ac_objext \
  3397. fi
  3398. ;;
  3399. + hyperbolabsd*)
  3400. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3401. + hardcode_direct_FC=yes
  3402. + hardcode_shlibpath_var_FC=no
  3403. + hardcode_direct_absolute_FC=yes
  3404. + archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3405. + hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
  3406. + else
  3407. + ld_shlibs_FC=no
  3408. + fi
  3409. + ;;
  3410. +
  3411. os2*)
  3412. hardcode_libdir_flag_spec_FC='-L$libdir'
  3413. hardcode_minus_L_FC=yes
  3414. @@ -15558,6 +15609,16 @@ openbsd*)
  3415. fi
  3416. ;;
  3417. +hyperbolabsd*)
  3418. + version_type=sunos
  3419. + need_lib_prefix=no
  3420. + need_version=no
  3421. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  3422. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  3423. + shlibpath_var=LD_LIBRARY_PATH
  3424. + shlibpath_overrides_runpath=yes
  3425. + ;;
  3426. +
  3427. os2*)
  3428. libname_spec='$name'
  3429. shrext_cmds=".dll"
  3430. diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c
  3431. index 4a40ce4..808cbaa 100644
  3432. --- a/libgfortran/intrinsics/random.c
  3433. +++ b/libgfortran/intrinsics/random.c
  3434. @@ -3,6 +3,9 @@
  3435. Contributed by Lars Segerlund <seger@linuxmail.org>,
  3436. Steve Kargl and Janne Blomqvist.
  3437. + Modifications to support HyperbolaBSD:
  3438. + Copyright (C) 2024 Hyperbola Project
  3439. +
  3440. This file is part of the GNU Fortran runtime library (libgfortran).
  3441. Libgfortran is free software; you can redistribute it and/or
  3442. @@ -303,7 +306,7 @@ getosrandom (void *buf, size_t buflen)
  3443. TODO: When glibc adds a wrapper for the getrandom() system call
  3444. on Linux, one could use that.
  3445. - TODO: One could use getentropy() on OpenBSD. */
  3446. + TODO: One could use getentropy() on OpenBSD (and HyperbolaBSD). */
  3447. int flags = O_RDONLY;
  3448. #ifdef O_CLOEXEC
  3449. flags |= O_CLOEXEC;
  3450. diff --git a/libgo/Makefile.am b/libgo/Makefile.am
  3451. index 1a9e498..b0fa65a 100644
  3452. --- a/libgo/Makefile.am
  3453. +++ b/libgo/Makefile.am
  3454. @@ -1,6 +1,10 @@
  3455. # Makefile.am -- Go library Makefile.
  3456. # Copyright 2009 The Go Authors. All rights reserved.
  3457. +#
  3458. +# Modifications to support HyperbolaBSD:
  3459. +# Copyright (C) 2020-2024 Hyperbola Project
  3460. +#
  3461. # Use of this source code is governed by a BSD-style
  3462. # license that can be found in the LICENSE file.
  3463. @@ -426,6 +430,9 @@ else
  3464. if LIBGO_IS_NETBSD
  3465. runtime_getncpu_file = runtime/getncpu-bsd.c
  3466. else
  3467. +if LIBGO_IS_HYPERBOLABSD
  3468. +runtime_getncpu_file = runtime/getncpu-bsd.c
  3469. +else
  3470. if LIBGO_IS_AIX
  3471. runtime_getncpu_file = runtime/getncpu-aix.c
  3472. else
  3473. @@ -437,6 +444,7 @@ endif
  3474. endif
  3475. endif
  3476. endif
  3477. +endif
  3478. runtime_files = \
  3479. runtime/aeshash.c \
  3480. diff --git a/libgo/Makefile.in b/libgo/Makefile.in
  3481. index b9f2700..13abb62 100644
  3482. --- a/libgo/Makefile.in
  3483. +++ b/libgo/Makefile.in
  3484. @@ -4,6 +4,10 @@
  3485. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
  3486. # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
  3487. # Foundation, Inc.
  3488. +#
  3489. +# Modifications to support HyperbolaBSD:
  3490. +# Copyright (C) 2024 Hyperbola Project
  3491. +#
  3492. # This Makefile.in is free software; the Free Software Foundation
  3493. # gives unlimited permission to copy and/or distribute it,
  3494. # with or without modifications, as long as this notice is preserved.
  3495. @@ -186,9 +190,10 @@ am__DEPENDENCIES_4 = $(am__DEPENDENCIES_2) \
  3496. $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_3)
  3497. libgo_llgo_la_DEPENDENCIES = $(am__DEPENDENCIES_4)
  3498. @LIBGO_IS_RTEMS_TRUE@am__objects_1 = rtems-task-variable-add.lo
  3499. -@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-none.lo
  3500. -@LIBGO_IS_AIX_TRUE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-aix.lo
  3501. -@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-bsd.lo
  3502. +@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_HYPERBOLABSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-none.lo
  3503. +@LIBGO_IS_AIX_TRUE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_HYPERBOLABSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-aix.lo
  3504. +@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@@LIBGO_IS_HYPERBOLABSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-bsd.lo
  3505. +@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_HYPERBOLABSD_TRUE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-bsd.lo
  3506. @LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-bsd.lo
  3507. @LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_TRUE@am__objects_2 = getncpu-solaris.lo
  3508. @LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_IRIX_TRUE@@LIBGO_IS_LINUX_FALSE@am__objects_2 = getncpu-irix.lo
  3509. @@ -762,9 +767,10 @@ noinst_DATA = golang_org/x/net/internal/nettest.gox \
  3510. zdefaultcc.go
  3511. @LIBGO_IS_RTEMS_FALSE@rtems_task_variable_add_file =
  3512. @LIBGO_IS_RTEMS_TRUE@rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
  3513. -@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-none.c
  3514. -@LIBGO_IS_AIX_TRUE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-aix.c
  3515. -@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-bsd.c
  3516. +@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_HYPERBOLABSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-none.c
  3517. +@LIBGO_IS_AIX_TRUE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_HYPERBOLABSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-aix.c
  3518. +@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@@LIBGO_IS_HYPERBOLABSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-bsd.c
  3519. +@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_HYPERBOLABSD_TRUE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-bsd.c
  3520. @LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-bsd.c
  3521. @LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_TRUE@runtime_getncpu_file = runtime/getncpu-solaris.c
  3522. @LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_IRIX_TRUE@@LIBGO_IS_LINUX_FALSE@runtime_getncpu_file = runtime/getncpu-irix.c
  3523. diff --git a/libgo/config/libtool.m4 b/libgo/config/libtool.m4
  3524. index f700594..a1cb1b5 100644
  3525. --- a/libgo/config/libtool.m4
  3526. +++ b/libgo/config/libtool.m4
  3527. @@ -4,6 +4,9 @@
  3528. # 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  3529. # Written by Gordon Matzigkeit, 1996
  3530. #
  3531. +# Modifications to support HyperbolaBSD:
  3532. +# Copyright (C) 2020-2024 Hyperbola Project
  3533. +#
  3534. # This file is free software; the Free Software Foundation gives
  3535. # unlimited permission to copy and/or distribute it, with or without
  3536. # modifications, as long as this notice is preserved.
  3537. @@ -13,6 +16,9 @@ m4_define([_LT_COPYING], [dnl
  3538. # 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  3539. # Written by Gordon Matzigkeit, 1996
  3540. #
  3541. +# Modifications to support HyperbolaBSD:
  3542. +# Copyright (C) 2020-2024 Hyperbola Project
  3543. +#
  3544. # This file is part of GNU Libtool.
  3545. #
  3546. # GNU Libtool is free software; you can redistribute it and/or
  3547. @@ -1518,7 +1524,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  3548. lt_cv_sys_max_cmd_len=8192;
  3549. ;;
  3550. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  3551. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  3552. # This has been around since 386BSD, at least. Likely further.
  3553. if test -x /sbin/sysctl; then
  3554. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  3555. @@ -2562,6 +2568,16 @@ openbsd*)
  3556. fi
  3557. ;;
  3558. +hyperbolabsd*)
  3559. + version_type=sunos
  3560. + need_lib_prefix=no
  3561. + need_version=no
  3562. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  3563. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  3564. + shlibpath_var=LD_LIBRARY_PATH
  3565. + shlibpath_overrides_runpath=yes
  3566. + ;;
  3567. +
  3568. os2*)
  3569. libname_spec='$name'
  3570. shrext_cmds=".dll"
  3571. @@ -3124,6 +3140,10 @@ openbsd*)
  3572. fi
  3573. ;;
  3574. +hyperbolabsd*)
  3575. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  3576. + ;;
  3577. +
  3578. osf3* | osf4* | osf5*)
  3579. lt_cv_deplibs_check_method=pass_all
  3580. ;;
  3581. @@ -3803,7 +3823,7 @@ m4_if([$1], [CXX], [
  3582. ;;
  3583. esac
  3584. ;;
  3585. - netbsd*)
  3586. + netbsd* | hyperbolabsd*)
  3587. ;;
  3588. *qnx* | *nto*)
  3589. # QNX uses GNU C++, but need to define -shared option too, otherwise
  3590. @@ -4539,6 +4559,11 @@ _LT_EOF
  3591. fi
  3592. ;;
  3593. + hyperbolabsd*)
  3594. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  3595. + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  3596. + ;;
  3597. +
  3598. solaris*)
  3599. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  3600. _LT_TAGVAR(ld_shlibs, $1)=no
  3601. @@ -5001,6 +5026,18 @@ _LT_EOF
  3602. fi
  3603. ;;
  3604. + hyperbolabsd*)
  3605. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3606. + _LT_TAGVAR(hardcode_direct, $1)=yes
  3607. + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  3608. + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  3609. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3610. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  3611. + else
  3612. + _LT_TAGVAR(ld_shlibs, $1)=no
  3613. + fi
  3614. + ;;
  3615. +
  3616. os2*)
  3617. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  3618. _LT_TAGVAR(hardcode_minus_L, $1)=yes
  3619. @@ -6155,6 +6192,18 @@ if test "$_lt_caught_CXX_error" != yes; then
  3620. fi
  3621. ;;
  3622. + hyperbolabsd*)
  3623. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3624. + _LT_TAGVAR(hardcode_direct, $1)=yes
  3625. + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  3626. + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  3627. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3628. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  3629. + else
  3630. + _LT_TAGVAR(ld_shlibs, $1)=no
  3631. + fi
  3632. + ;;
  3633. +
  3634. osf3* | osf4* | osf5*)
  3635. case $cc_basename in
  3636. KCC*)
  3637. diff --git a/libgo/config/ltmain.sh b/libgo/config/ltmain.sh
  3638. index ce66b44..ca77049 100644
  3639. --- a/libgo/config/ltmain.sh
  3640. +++ b/libgo/config/ltmain.sh
  3641. @@ -5,6 +5,10 @@
  3642. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
  3643. # 2007, 2008, 2009 Free Software Foundation, Inc.
  3644. +#
  3645. +# Modifications to support HyperbolaBSD:
  3646. +# Copyright (C) 2020-2024 Hyperbola Project
  3647. +#
  3648. # This is free software; see the source for copying conditions. There is NO
  3649. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  3650. @@ -4741,7 +4745,7 @@ func_mode_link ()
  3651. # These systems don't actually have a C library (as such)
  3652. test "X$arg" = "X-lc" && continue
  3653. ;;
  3654. - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  3655. + *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly*)
  3656. # Do not include libc due to us having libc/libc_r.
  3657. test "X$arg" = "X-lc" && continue
  3658. ;;
  3659. @@ -4764,7 +4768,7 @@ func_mode_link ()
  3660. esac
  3661. elif test "X$arg" = "X-lc_r"; then
  3662. case $host in
  3663. - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  3664. + *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly*)
  3665. # Do not include libc_r directly, use -pthread flag.
  3666. continue
  3667. ;;
  3668. @@ -6703,7 +6707,7 @@ func_mode_link ()
  3669. *-*-netbsd*)
  3670. # Don't link with libc until the a.out ld.so is fixed.
  3671. ;;
  3672. - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  3673. + *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly*)
  3674. # Do not include libc due to us having libc/libc_r.
  3675. ;;
  3676. *-*-sco3.2v5* | *-*-sco5v6*)
  3677. diff --git a/libgo/configure b/libgo/configure
  3678. index 7138eda..f548a2a 100755
  3679. --- a/libgo/configure
  3680. +++ b/libgo/configure
  3681. @@ -6,6 +6,9 @@
  3682. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  3683. # Foundation, Inc.
  3684. #
  3685. +# Modifications to support HyperbolaBSD:
  3686. +# Copyright (C) 2020-2024 Hyperbola Project
  3687. +#
  3688. # This configure script is free software; the Free Software Foundation
  3689. # gives unlimited permission to copy, distribute and modify it.
  3690. ## -------------------- ##
  3691. @@ -646,6 +649,8 @@ LIBGO_IS_RTEMS_FALSE
  3692. LIBGO_IS_RTEMS_TRUE
  3693. LIBGO_IS_DRAGONFLY_FALSE
  3694. LIBGO_IS_DRAGONFLY_TRUE
  3695. +LIBGO_IS_HYPERBOLABSD_FALSE
  3696. +LIBGO_IS_HYPERBOLABSD_TRUE
  3697. LIBGO_IS_OPENBSD_FALSE
  3698. LIBGO_IS_OPENBSD_TRUE
  3699. LIBGO_IS_NETBSD_FALSE
  3700. @@ -5306,7 +5311,7 @@ else
  3701. lt_cv_sys_max_cmd_len=8192;
  3702. ;;
  3703. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  3704. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  3705. # This has been around since 386BSD, at least. Likely further.
  3706. if test -x /sbin/sysctl; then
  3707. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  3708. @@ -5744,6 +5749,10 @@ openbsd*)
  3709. fi
  3710. ;;
  3711. +hyperbolabsd*)
  3712. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  3713. + ;;
  3714. +
  3715. osf3* | osf4* | osf5*)
  3716. lt_cv_deplibs_check_method=pass_all
  3717. ;;
  3718. @@ -8971,6 +8980,11 @@ _LT_EOF
  3719. fi
  3720. ;;
  3721. + hyperbolabsd*)
  3722. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  3723. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  3724. + ;;
  3725. +
  3726. solaris*)
  3727. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  3728. ld_shlibs=no
  3729. @@ -9557,6 +9571,18 @@ rm -f core conftest.err conftest.$ac_objext \
  3730. fi
  3731. ;;
  3732. + hyperbolabsd*)
  3733. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3734. + hardcode_direct=yes
  3735. + hardcode_shlibpath_var=no
  3736. + hardcode_direct_absolute=yes
  3737. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3738. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  3739. + else
  3740. + ld_shlibs=no
  3741. + fi
  3742. + ;;
  3743. +
  3744. os2*)
  3745. hardcode_libdir_flag_spec='-L$libdir'
  3746. hardcode_minus_L=yes
  3747. @@ -10544,6 +10570,16 @@ openbsd*)
  3748. fi
  3749. ;;
  3750. +hyperbolabsd*)
  3751. + version_type=sunos
  3752. + need_lib_prefix=no
  3753. + need_version=no
  3754. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  3755. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  3756. + shlibpath_var=LD_LIBRARY_PATH
  3757. + shlibpath_overrides_runpath=yes
  3758. + ;;
  3759. +
  3760. os2*)
  3761. libname_spec='$name'
  3762. shrext_cmds=".dll"
  3763. @@ -12388,6 +12424,11 @@ _LT_EOF
  3764. fi
  3765. ;;
  3766. + hyperbolabsd*)
  3767. + archive_cmds_GO='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  3768. + archive_expsym_cmds_GO='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  3769. + ;;
  3770. +
  3771. solaris*)
  3772. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  3773. ld_shlibs_GO=no
  3774. @@ -12935,6 +12976,18 @@ rm -f core conftest.err conftest.$ac_objext \
  3775. fi
  3776. ;;
  3777. + hyperbolabsd*)
  3778. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  3779. + hardcode_direct_GO=yes
  3780. + hardcode_shlibpath_var_GO=no
  3781. + hardcode_direct_absolute_GO=yes
  3782. + archive_cmds_GO='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  3783. + hardcode_libdir_flag_spec_GO='${wl}-rpath,$libdir'
  3784. + else
  3785. + ld_shlibs_GO=no
  3786. + fi
  3787. + ;;
  3788. +
  3789. os2*)
  3790. hardcode_libdir_flag_spec_GO='-L$libdir'
  3791. hardcode_minus_L_GO=yes
  3792. @@ -13509,7 +13562,7 @@ go_include="-include"
  3793. # All known GOOS values. This is the union of all operating systems
  3794. # supported by the gofrontend and all operating systems supported by
  3795. # the gc toolchain.
  3796. -ALLGOOS="aix android darwin dragonfly freebsd irix linux netbsd openbsd plan9 rtems solaris windows"
  3797. +ALLGOOS="aix android darwin dragonfly freebsd irix linux netbsd openbsd hyperbolabsd plan9 rtems solaris windows"
  3798. is_darwin=no
  3799. is_freebsd=no
  3800. @@ -13518,6 +13571,7 @@ is_linux=no
  3801. is_netbsd=no
  3802. is_openbsd=no
  3803. is_dragonfly=no
  3804. +is_hyperbolabsd=no
  3805. is_rtems=no
  3806. is_solaris=no
  3807. is_aix=no
  3808. @@ -13530,6 +13584,7 @@ case ${host} in
  3809. *-*-netbsd*) is_netbsd=yes; GOOS=netbsd ;;
  3810. *-*-openbsd*) is_openbsd=yes; GOOS=openbsd ;;
  3811. *-*-dragonfly*) is_dragonfly=yes; GOOS=dragonfly ;;
  3812. + *-*-hyperbolabsd*) is_hyperbolabsd=yes; GOOS=hyperbolabsd ;;
  3813. *-*-rtems*) is_rtems=yes; GOOS=rtems ;;
  3814. *-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
  3815. *-*-aix*) is_aix=yes; GOOS=aix ;;
  3816. @@ -13590,6 +13645,14 @@ else
  3817. LIBGO_IS_DRAGONFLY_FALSE=
  3818. fi
  3819. + if test $is_hyperbolabsd = yes; then
  3820. + LIBGO_IS_HYPERBOLABSD_TRUE=
  3821. + LIBGO_IS_HYPERBOLABSD_FALSE='#'
  3822. +else
  3823. + LIBGO_IS_HYPERBOLABSD_TRUE='#'
  3824. + LIBGO_IS_HYPERBOLABSD_FALSE=
  3825. +fi
  3826. +
  3827. if test $is_rtems = yes; then
  3828. LIBGO_IS_RTEMS_TRUE=
  3829. LIBGO_IS_RTEMS_FALSE='#'
  3830. @@ -13614,7 +13677,7 @@ else
  3831. LIBGO_IS_AIX_FALSE=
  3832. fi
  3833. - if test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes; then
  3834. + if test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes -o $is_hyperbolabsd = yes; then
  3835. LIBGO_IS_BSD_TRUE=
  3836. LIBGO_IS_BSD_FALSE='#'
  3837. else
  3838. @@ -15672,6 +15735,10 @@ if test -z "${LIBGO_IS_DRAGONFLY_TRUE}" && test -z "${LIBGO_IS_DRAGONFLY_FALSE}"
  3839. as_fn_error "conditional \"LIBGO_IS_DRAGONFLY\" was never defined.
  3840. Usually this means the macro was only invoked conditionally." "$LINENO" 5
  3841. fi
  3842. +if test -z "${LIBGO_IS_HYPERBOLABSD_TRUE}" && test -z "${LIBGO_IS_HYPERBOLABSD_FALSE}"; then
  3843. + as_fn_error "conditional \"LIBGO_IS_HYPERBOLABSD\" was never defined.
  3844. +Usually this means the macro was only invoked conditionally." "$LINENO" 5
  3845. +fi
  3846. if test -z "${LIBGO_IS_RTEMS_TRUE}" && test -z "${LIBGO_IS_RTEMS_FALSE}"; then
  3847. as_fn_error "conditional \"LIBGO_IS_RTEMS\" was never defined.
  3848. Usually this means the macro was only invoked conditionally." "$LINENO" 5
  3849. diff --git a/libgo/configure.ac b/libgo/configure.ac
  3850. index 2c6b08f..33a5eda 100644
  3851. --- a/libgo/configure.ac
  3852. +++ b/libgo/configure.ac
  3853. @@ -1,6 +1,10 @@
  3854. # configure.ac -- Go library configure script.
  3855. # Copyright 2009 The Go Authors. All rights reserved.
  3856. +#
  3857. +# Modifications to support HyperbolaBSD:
  3858. +# Copyright (C) 2020-2024 Hyperbola Project
  3859. +#
  3860. # Use of this source code is governed by a BSD-style
  3861. # license that can be found in the LICENSE file.
  3862. @@ -154,7 +158,7 @@ AC_SUBST(go_include)
  3863. # All known GOOS values. This is the union of all operating systems
  3864. # supported by the gofrontend and all operating systems supported by
  3865. # the gc toolchain.
  3866. -ALLGOOS="aix android darwin dragonfly freebsd irix linux netbsd openbsd plan9 rtems solaris windows"
  3867. +ALLGOOS="aix android darwin dragonfly freebsd irix linux netbsd openbsd hyperbolabsd plan9 rtems solaris windows"
  3868. is_darwin=no
  3869. is_freebsd=no
  3870. @@ -163,6 +167,7 @@ is_linux=no
  3871. is_netbsd=no
  3872. is_openbsd=no
  3873. is_dragonfly=no
  3874. +is_hyperbolabsd=no
  3875. is_rtems=no
  3876. is_solaris=no
  3877. is_aix=no
  3878. @@ -175,6 +180,7 @@ case ${host} in
  3879. *-*-netbsd*) is_netbsd=yes; GOOS=netbsd ;;
  3880. *-*-openbsd*) is_openbsd=yes; GOOS=openbsd ;;
  3881. *-*-dragonfly*) is_dragonfly=yes; GOOS=dragonfly ;;
  3882. + *-*-hyperbolabsd*) is_hyperbolabsd=yes; GOOS=hyperbolabsd ;;
  3883. *-*-rtems*) is_rtems=yes; GOOS=rtems ;;
  3884. *-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
  3885. *-*-aix*) is_aix=yes; GOOS=aix ;;
  3886. @@ -186,10 +192,11 @@ AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)
  3887. AM_CONDITIONAL(LIBGO_IS_NETBSD, test $is_netbsd = yes)
  3888. AM_CONDITIONAL(LIBGO_IS_OPENBSD, test $is_openbsd = yes)
  3889. AM_CONDITIONAL(LIBGO_IS_DRAGONFLY, test $is_dragonfly = yes)
  3890. +AM_CONDITIONAL(LIBGO_IS_HYPERBOLABSD, test $is_hyperbolabsd = yes)
  3891. AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)
  3892. AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes)
  3893. AM_CONDITIONAL(LIBGO_IS_AIX, test $is_aix = yes)
  3894. -AM_CONDITIONAL(LIBGO_IS_BSD, test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes)
  3895. +AM_CONDITIONAL(LIBGO_IS_BSD, test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes -o $is_hyperbolabsd = yes)
  3896. AC_SUBST(GOOS)
  3897. AC_SUBST(ALLGOOS)
  3898. diff --git a/libgo/go/archive/tar/stat_actime1.go b/libgo/go/archive/tar/stat_actime1.go
  3899. index 1bdd1c9..7979ca8 100644
  3900. --- a/libgo/go/archive/tar/stat_actime1.go
  3901. +++ b/libgo/go/archive/tar/stat_actime1.go
  3902. @@ -1,8 +1,12 @@
  3903. // Copyright 2012 The Go Authors. All rights reserved.
  3904. +//
  3905. +// Modifications to support HyperbolaBSD:
  3906. +// Copyright (C) 2020-2024 Hyperbola Project
  3907. +//
  3908. // Use of this source code is governed by a BSD-style
  3909. // license that can be found in the LICENSE file.
  3910. -// +build aix linux dragonfly openbsd solaris
  3911. +// +build aix linux dragonfly openbsd hyperbolabsd solaris
  3912. package tar
  3913. diff --git a/libgo/go/archive/tar/stat_unix.go b/libgo/go/archive/tar/stat_unix.go
  3914. index c37a57a..bf7e6ec 100644
  3915. --- a/libgo/go/archive/tar/stat_unix.go
  3916. +++ b/libgo/go/archive/tar/stat_unix.go
  3917. @@ -1,8 +1,12 @@
  3918. // Copyright 2012 The Go Authors. All rights reserved.
  3919. +//
  3920. +// Modifications to support HyperbolaBSD:
  3921. +// Copyright (C) 2020-2024 Hyperbola Project
  3922. +//
  3923. // Use of this source code is governed by a BSD-style
  3924. // license that can be found in the LICENSE file.
  3925. -// +build aix linux darwin dragonfly freebsd openbsd netbsd solaris
  3926. +// +build aix linux darwin dragonfly freebsd hyperbolabsd openbsd netbsd solaris
  3927. package tar
  3928. @@ -98,6 +102,12 @@ func statUnix(fi os.FileInfo, h *Header) error {
  3929. minor := uint32((dev & 0x000000ff) >> 0)
  3930. minor |= uint32((dev & 0xffff0000) >> 8)
  3931. h.Devmajor, h.Devminor = int64(major), int64(minor)
  3932. + case "hyperbolabsd":
  3933. + // Copied from golang.org/x/sys/unix/dev_openbsd.go.
  3934. + major := uint32((dev & 0x0000ff00) >> 8)
  3935. + minor := uint32((dev & 0x000000ff) >> 0)
  3936. + minor |= uint32((dev & 0xffff0000) >> 8)
  3937. + h.Devmajor, h.Devminor = int64(major), int64(minor)
  3938. default:
  3939. // TODO: Implement solaris (see https://golang.org/issue/8106)
  3940. }
  3941. diff --git a/libgo/go/cmd/go/go_test.go b/libgo/go/cmd/go/go_test.go
  3942. index 959fcb5..57fc207 100644
  3943. --- a/libgo/go/cmd/go/go_test.go
  3944. +++ b/libgo/go/cmd/go/go_test.go
  3945. @@ -1,4 +1,8 @@
  3946. // Copyright 2015 The Go Authors. All rights reserved.
  3947. +//
  3948. +// Modifications to support HyperbolaBSD:
  3949. +// Copyright (C) 2020-2024 Hyperbola Project
  3950. +//
  3951. // Use of this source code is governed by a BSD-style
  3952. // license that can be found in the LICENSE file.
  3953. @@ -2845,10 +2849,11 @@ func TestCgoPkgConfig(t *testing.T) {
  3954. t.Skipf("%s --atleast-pkgconfig-version 0.24: %v\n%s", pkgConfig, err, out)
  3955. }
  3956. - // OpenBSD's pkg-config is strict about whitespace and only
  3957. - // supports backslash-escaped whitespace. It does not support
  3958. - // quotes, which the normal freedesktop.org pkg-config does
  3959. - // support. See http://man.openbsd.org/pkg-config.1
  3960. + // HyperbolaBSD and OpenBSD's pkg-config is strict about
  3961. + // whitespace and only supports backslash-escaped whitespace.
  3962. + // It does not support quotes, which the normal freedesktop.org
  3963. + // pkg-config does support.
  3964. + // See http://man.openbsd.org/pkg-config.1
  3965. tg.tempFile("foo.pc", `
  3966. Name: foo
  3967. Description: The foo library
  3968. @@ -4555,6 +4560,8 @@ func TestExecutableGOROOT(t *testing.T) {
  3969. skipIfGccgo(t, "gccgo has no GOROOT")
  3970. if runtime.GOOS == "openbsd" {
  3971. t.Skipf("test case does not work on %s, missing os.Executable", runtime.GOOS)
  3972. + } else if runtime.GOOS == "hyperbolabsd" {
  3973. + t.Skipf("test case does not work on %s, missing os.Executable", runtime.GOOS)
  3974. }
  3975. // Env with no GOROOT.
  3976. diff --git a/libgo/go/cmd/go/go_unix_test.go b/libgo/go/cmd/go/go_unix_test.go
  3977. index f6e10ca..1a8d5ee 100644
  3978. --- a/libgo/go/cmd/go/go_unix_test.go
  3979. +++ b/libgo/go/cmd/go/go_unix_test.go
  3980. @@ -1,8 +1,12 @@
  3981. // Copyright 2015 The Go Authors. All rights reserved.
  3982. +//
  3983. +// Modifications to support HyperbolaBSD:
  3984. +// Copyright (C) 2020-2024 Hyperbola Project
  3985. +//
  3986. // Use of this source code is governed by a BSD-style
  3987. // license that can be found in the LICENSE file.
  3988. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  3989. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  3990. package main_test
  3991. diff --git a/libgo/go/cmd/go/internal/base/signal_unix.go b/libgo/go/cmd/go/internal/base/signal_unix.go
  3992. index b90f3a2..e7384f5 100644
  3993. --- a/libgo/go/cmd/go/internal/base/signal_unix.go
  3994. +++ b/libgo/go/cmd/go/internal/base/signal_unix.go
  3995. @@ -1,8 +1,12 @@
  3996. // Copyright 2012 The Go Authors. All rights reserved.
  3997. +//
  3998. +// Modifications to support HyperbolaBSD:
  3999. +// Copyright (C) 2020-2024 Hyperbola Project
  4000. +//
  4001. // Use of this source code is governed by a BSD-style
  4002. // license that can be found in the LICENSE file.
  4003. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  4004. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  4005. package base
  4006. diff --git a/libgo/go/cmd/go/internal/bug/bug.go b/libgo/go/cmd/go/internal/bug/bug.go
  4007. index 963da94..1cad669 100644
  4008. --- a/libgo/go/cmd/go/internal/bug/bug.go
  4009. +++ b/libgo/go/cmd/go/internal/bug/bug.go
  4010. @@ -1,4 +1,8 @@
  4011. // Copyright 2016 The Go Authors. All rights reserved.
  4012. +//
  4013. +// Modifications to support HyperbolaBSD:
  4014. +// Copyright (C) 2020-2024 Hyperbola Project
  4015. +//
  4016. // Use of this source code is governed by a BSD-style
  4017. // license that can be found in the LICENSE file.
  4018. @@ -96,7 +100,7 @@ func printOSDetails(w io.Writer) {
  4019. printCmdOut(w, "uname -sr: ", "uname", "-sr")
  4020. printCmdOut(w, "", "lsb_release", "-a")
  4021. printGlibcVersion(w)
  4022. - case "openbsd", "netbsd", "freebsd", "dragonfly":
  4023. + case "hyperbolabsd", "openbsd", "netbsd", "freebsd", "dragonfly":
  4024. printCmdOut(w, "uname -v: ", "uname", "-v")
  4025. case "solaris":
  4026. out, err := ioutil.ReadFile("/etc/release")
  4027. diff --git a/libgo/go/cmd/go/internal/work/exec.go b/libgo/go/cmd/go/internal/work/exec.go
  4028. index 5994dbc..8bd93a4 100644
  4029. --- a/libgo/go/cmd/go/internal/work/exec.go
  4030. +++ b/libgo/go/cmd/go/internal/work/exec.go
  4031. @@ -1,4 +1,8 @@
  4032. // Copyright 2011 The Go Authors. All rights reserved.
  4033. +//
  4034. +// Modifications to support HyperbolaBSD:
  4035. +// Copyright (C) 2020-2024 Hyperbola Project
  4036. +//
  4037. // Use of this source code is governed by a BSD-style
  4038. // license that can be found in the LICENSE file.
  4039. @@ -642,7 +646,7 @@ func (b *Builder) build(a *Action) (err error) {
  4040. // This is read by readGccgoArchive in cmd/internal/buildid/buildid.go.
  4041. if a.buildID != "" && cfg.BuildToolchainName == "gccgo" {
  4042. switch cfg.Goos {
  4043. - case "android", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris":
  4044. + case "android", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd", "solaris":
  4045. asmfile, err := b.gccgoBuildIDELFFile(a)
  4046. if err != nil {
  4047. return err
  4048. diff --git a/libgo/go/cmd/go/internal/work/init.go b/libgo/go/cmd/go/internal/work/init.go
  4049. index c2beb3b..2cee120 100644
  4050. --- a/libgo/go/cmd/go/internal/work/init.go
  4051. +++ b/libgo/go/cmd/go/internal/work/init.go
  4052. @@ -1,4 +1,8 @@
  4053. // Copyright 2017 The Go Authors. All rights reserved.
  4054. +//
  4055. +// Modifications to support HyperbolaBSD:
  4056. +// Copyright (C) 2020-2024 Hyperbola Project
  4057. +//
  4058. // Use of this source code is governed by a BSD-style
  4059. // license that can be found in the LICENSE file.
  4060. @@ -82,7 +86,7 @@ func buildModeInit() {
  4061. codegenArg = "-shared"
  4062. default:
  4063. switch cfg.Goos {
  4064. - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris":
  4065. + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd", "solaris":
  4066. // Use -shared so that the result is
  4067. // suitable for inclusion in a PIE or
  4068. // shared library.
  4069. diff --git a/libgo/go/cmd/go/note_test.go b/libgo/go/cmd/go/note_test.go
  4070. index 7ef4c64..2fe3c3b 100644
  4071. --- a/libgo/go/cmd/go/note_test.go
  4072. +++ b/libgo/go/cmd/go/note_test.go
  4073. @@ -1,4 +1,8 @@
  4074. // Copyright 2015 The Go Authors. All rights reserved.
  4075. +//
  4076. +// Modifications to support HyperbolaBSD:
  4077. +// Copyright (C) 2020-2024 Hyperbola Project
  4078. +//
  4079. // Use of this source code is governed by a BSD-style
  4080. // license that can be found in the LICENSE file.
  4081. @@ -36,6 +40,8 @@ func TestNoteReading(t *testing.T) {
  4082. t.Skipf("skipping - no cgo, so assuming external linking not available")
  4083. case runtime.GOOS == "openbsd" && runtime.GOARCH == "arm":
  4084. t.Skipf("skipping - external linking not supported, golang.org/issue/10619")
  4085. + case runtime.GOOS == "hyperbolabsd" && runtime.GOARCH == "arm":
  4086. + t.Skipf("skipping - external linking not supported, golang.org/issue/10619")
  4087. case runtime.GOOS == "plan9":
  4088. t.Skipf("skipping - external linking not supported")
  4089. }
  4090. @@ -50,7 +56,7 @@ func TestNoteReading(t *testing.T) {
  4091. }
  4092. switch runtime.GOOS {
  4093. - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd":
  4094. + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd":
  4095. // Test while forcing use of the gold linker, since in the past
  4096. // we've had trouble reading the notes generated by gold.
  4097. err := tg.doRun([]string{"build", "-ldflags", "-buildid=" + buildID + " -linkmode=external -extldflags=-fuse-ld=gold", "-o", tg.path("hello3.exe"), tg.path("hello.go")})
  4098. diff --git a/libgo/go/cmd/internal/objabi/head.go b/libgo/go/cmd/internal/objabi/head.go
  4099. index ff19606..9d9f1b5 100644
  4100. --- a/libgo/go/cmd/internal/objabi/head.go
  4101. +++ b/libgo/go/cmd/internal/objabi/head.go
  4102. @@ -10,6 +10,9 @@
  4103. // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
  4104. // Portions Copyright © 2009 The Go Authors. All rights reserved.
  4105. //
  4106. +// Modifications to support HyperbolaBSD:
  4107. +// Copyright (C) 2020-2024 Hyperbola Project
  4108. +//
  4109. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4110. // of this software and associated documentation files (the "Software"), to deal
  4111. // in the Software without restriction, including without limitation the rights
  4112. @@ -44,6 +47,7 @@ const (
  4113. Hnacl
  4114. Hnetbsd
  4115. Hopenbsd
  4116. + Hhyperbolabsd
  4117. Hplan9
  4118. Hsolaris
  4119. Hwindows
  4120. @@ -65,6 +69,8 @@ func (h *HeadType) Set(s string) error {
  4121. *h = Hnetbsd
  4122. case "openbsd":
  4123. *h = Hopenbsd
  4124. + case "hyperbolabsd":
  4125. + *h = Hhyperbolabsd
  4126. case "plan9":
  4127. *h = Hplan9
  4128. case "solaris":
  4129. @@ -93,6 +99,8 @@ func (h *HeadType) String() string {
  4130. return "netbsd"
  4131. case Hopenbsd:
  4132. return "openbsd"
  4133. + case Hhyperbolabsd:
  4134. + return "hyperbolabsd"
  4135. case Hplan9:
  4136. return "plan9"
  4137. case Hsolaris:
  4138. diff --git b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_386.txt b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_386.txt
  4139. new file mode 100644
  4140. index 0000000..93f6404
  4141. --- /dev/null
  4142. +++ b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_386.txt
  4143. @@ -0,0 +1,17 @@
  4144. +// hyperbolabsd-386-specific vet whitelist. See readme.txt for details.
  4145. +
  4146. +runtime/sys_hyperbolabsd_386.s: [386] sigtramp: unknown variable signo
  4147. +runtime/sys_hyperbolabsd_386.s: [386] sigtramp: unknown variable info
  4148. +runtime/sys_hyperbolabsd_386.s: [386] sigtramp: unknown variable context
  4149. +runtime/sys_hyperbolabsd_386.s: [386] setldt: function setldt missing Go declaration
  4150. +runtime/sys_hyperbolabsd_386.s: [386] settls: function settls missing Go declaration
  4151. +syscall/asm_unix_386.s: [386] Syscall: 8(SP) should be a1+4(FP)
  4152. +syscall/asm_unix_386.s: [386] Syscall: 4(SP) should be trap+0(FP)
  4153. +syscall/asm_unix_386.s: [386] Syscall6: 8(SP) should be a1+4(FP)
  4154. +syscall/asm_unix_386.s: [386] Syscall6: 4(SP) should be trap+0(FP)
  4155. +syscall/asm_unix_386.s: [386] Syscall9: 8(SP) should be a1+4(FP)
  4156. +syscall/asm_unix_386.s: [386] Syscall9: 4(SP) should be num+0(FP)
  4157. +syscall/asm_unix_386.s: [386] RawSyscall: 8(SP) should be a1+4(FP)
  4158. +syscall/asm_unix_386.s: [386] RawSyscall: 4(SP) should be trap+0(FP)
  4159. +syscall/asm_unix_386.s: [386] RawSyscall6: 8(SP) should be a1+4(FP)
  4160. +syscall/asm_unix_386.s: [386] RawSyscall6: 4(SP) should be trap+0(FP)
  4161. diff --git b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_amd64.txt b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_amd64.txt
  4162. new file mode 100644
  4163. index 0000000..c58a57a
  4164. --- /dev/null
  4165. +++ b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_amd64.txt
  4166. @@ -0,0 +1,3 @@
  4167. +// hyperbolabsd-amd64-specific vet whitelist. See readme.txt for details.
  4168. +
  4169. +runtime/sys_hyperbolabsd_amd64.s: [amd64] settls: function settls missing Go declaration
  4170. diff --git b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_arm.txt b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_arm.txt
  4171. new file mode 100644
  4172. index 0000000..ea8dcd2
  4173. --- /dev/null
  4174. +++ b/libgo/go/cmd/vet/all/whitelist/hyperbolabsd_arm.txt
  4175. @@ -0,0 +1,4 @@
  4176. +// hyperbolabsd-arm-specific vet whitelist. See readme.txt for details.
  4177. +
  4178. +runtime/asm_arm.s: [arm] sigreturn: function sigreturn missing Go declaration
  4179. +runtime/sys_hyperbolabsd_arm.s: [arm] read_tls_fallback: function read_tls_fallback missing Go declaration
  4180. diff --git a/libgo/go/crypto/rand/eagain.go b/libgo/go/crypto/rand/eagain.go
  4181. index 045d037..7956518 100644
  4182. --- a/libgo/go/crypto/rand/eagain.go
  4183. +++ b/libgo/go/crypto/rand/eagain.go
  4184. @@ -1,8 +1,12 @@
  4185. // Copyright 2014 The Go Authors. All rights reserved.
  4186. +//
  4187. +// Modifications to support HyperbolaBSD:
  4188. +// Copyright (C) 2020-2024 Hyperbola Project
  4189. +//
  4190. // Use of this source code is governed by a BSD-style
  4191. // license that can be found in the LICENSE file.
  4192. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  4193. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  4194. package rand
  4195. diff --git a/libgo/go/crypto/rand/rand.go b/libgo/go/crypto/rand/rand.go
  4196. index 6f7523d..5b1ff0b 100644
  4197. --- a/libgo/go/crypto/rand/rand.go
  4198. +++ b/libgo/go/crypto/rand/rand.go
  4199. @@ -1,4 +1,8 @@
  4200. // Copyright 2010 The Go Authors. All rights reserved.
  4201. +//
  4202. +// Modifications to support HyperbolaBSD:
  4203. +// Copyright (C) 2024 Hyperbola Project
  4204. +//
  4205. // Use of this source code is governed by a BSD-style
  4206. // license that can be found in the LICENSE file.
  4207. @@ -12,7 +16,7 @@ import "io"
  4208. // strong pseudo-random generator.
  4209. //
  4210. // On Linux, Reader uses getrandom(2) if available, /dev/urandom otherwise.
  4211. -// On OpenBSD, Reader uses getentropy(2).
  4212. +// On OpenBSD (and HyperbolaBSD), Reader uses getentropy(2).
  4213. // On other Unix-like systems, Reader reads from /dev/urandom.
  4214. // On Windows systems, Reader uses the CryptGenRandom API.
  4215. var Reader io.Reader
  4216. diff --git b/libgo/go/crypto/rand/rand_hyperbolabsd.go b/libgo/go/crypto/rand/rand_hyperbolabsd.go
  4217. new file mode 100644
  4218. index 0000000..ca4f9bd
  4219. --- /dev/null
  4220. +++ b/libgo/go/crypto/rand/rand_hyperbolabsd.go
  4221. @@ -0,0 +1,32 @@
  4222. +// Copyright 2016 The Go Authors. All rights reserved.
  4223. +//
  4224. +// Modifications to support HyperbolaBSD:
  4225. +// Copyright (C) 2020-2024 Hyperbola Project
  4226. +//
  4227. +// Use of this source code is governed by a BSD-style
  4228. +// license that can be found in the LICENSE file.
  4229. +
  4230. +package rand
  4231. +
  4232. +import (
  4233. + "internal/syscall/unix"
  4234. +)
  4235. +
  4236. +func init() {
  4237. + altGetRandom = getRandomHyperbolaBSD
  4238. +}
  4239. +
  4240. +func getRandomHyperbolaBSD(p []byte) (ok bool) {
  4241. + // getentropy(2) returns a maximum of 256 bytes per call
  4242. + for i := 0; i < len(p); i += 256 {
  4243. + end := i + 256
  4244. + if len(p) < end {
  4245. + end = len(p)
  4246. + }
  4247. + err := unix.GetEntropy(p[i:end])
  4248. + if err != nil {
  4249. + return false
  4250. + }
  4251. + }
  4252. + return true
  4253. +}
  4254. diff --git a/libgo/go/crypto/rand/rand_unix.go b/libgo/go/crypto/rand/rand_unix.go
  4255. index ec474d3..f7aa49a 100644
  4256. --- a/libgo/go/crypto/rand/rand_unix.go
  4257. +++ b/libgo/go/crypto/rand/rand_unix.go
  4258. @@ -1,8 +1,12 @@
  4259. // Copyright 2010 The Go Authors. All rights reserved.
  4260. +//
  4261. +// Modifications to support HyperbolaBSD:
  4262. +// Copyright (C) 2020-2024 Hyperbola Project
  4263. +//
  4264. // Use of this source code is governed by a BSD-style
  4265. // license that can be found in the LICENSE file.
  4266. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris
  4267. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd plan9 solaris
  4268. // Unix cryptographically secure pseudorandom number
  4269. // generator.
  4270. diff --git a/libgo/go/crypto/x509/root_bsd.go b/libgo/go/crypto/x509/root_bsd.go
  4271. index 1371933..abaeaf7 100644
  4272. --- a/libgo/go/crypto/x509/root_bsd.go
  4273. +++ b/libgo/go/crypto/x509/root_bsd.go
  4274. @@ -1,15 +1,19 @@
  4275. // Copyright 2015 The Go Authors. All rights reserved.
  4276. +//
  4277. +// Modifications to support HyperbolaBSD:
  4278. +// Copyright (C) 2020-2024 Hyperbola Project
  4279. +//
  4280. // Use of this source code is governed by a BSD-style
  4281. // license that can be found in the LICENSE file.
  4282. -// +build dragonfly freebsd netbsd openbsd
  4283. +// +build dragonfly freebsd netbsd openbsd hyperbolabsd
  4284. package x509
  4285. // Possible certificate files; stop after finding one.
  4286. var certFiles = []string{
  4287. "/usr/local/etc/ssl/cert.pem", // FreeBSD
  4288. - "/etc/ssl/cert.pem", // OpenBSD
  4289. + "/etc/ssl/cert.pem", // OpenBSD and HyperbolaBSD
  4290. "/usr/local/share/certs/ca-root-nss.crt", // DragonFly
  4291. "/etc/openssl/certs/ca-certificates.crt", // NetBSD
  4292. }
  4293. diff --git a/libgo/go/crypto/x509/root_unix.go b/libgo/go/crypto/x509/root_unix.go
  4294. index 0547460..9f7cfe2 100644
  4295. --- a/libgo/go/crypto/x509/root_unix.go
  4296. +++ b/libgo/go/crypto/x509/root_unix.go
  4297. @@ -1,8 +1,12 @@
  4298. // Copyright 2011 The Go Authors. All rights reserved.
  4299. +//
  4300. +// Modifications to support HyperbolaBSD:
  4301. +// Copyright (C) 2020-2024 Hyperbola Project
  4302. +//
  4303. // Use of this source code is governed by a BSD-style
  4304. // license that can be found in the LICENSE file.
  4305. -// +build aix dragonfly freebsd linux nacl netbsd openbsd solaris
  4306. +// +build aix dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  4307. package x509
  4308. diff --git a/libgo/go/crypto/x509/root_unix_test.go b/libgo/go/crypto/x509/root_unix_test.go
  4309. index 03f935d..31913ca 100644
  4310. --- a/libgo/go/crypto/x509/root_unix_test.go
  4311. +++ b/libgo/go/crypto/x509/root_unix_test.go
  4312. @@ -1,8 +1,12 @@
  4313. // Copyright 2017 The Go Authors. All rights reserved.
  4314. +//
  4315. +// Modifications to support HyperbolaBSD:
  4316. +// Copyright (C) 2020-2024 Hyperbola Project
  4317. +//
  4318. // Use of this source code is governed by a BSD-style
  4319. // license that can be found in the LICENSE file.
  4320. -// +build dragonfly freebsd linux netbsd openbsd solaris
  4321. +// +build dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  4322. package x509
  4323. diff --git a/libgo/go/debug/elf/elf.go b/libgo/go/debug/elf/elf.go
  4324. index c8a4fe6..e74597e 100644
  4325. --- a/libgo/go/debug/elf/elf.go
  4326. +++ b/libgo/go/debug/elf/elf.go
  4327. @@ -17,6 +17,9 @@
  4328. * Copyright (c) 2001 David E. O'Brien
  4329. * Portions Copyright 2009 The Go Authors. All rights reserved.
  4330. *
  4331. + * Modifications to support HyperbolaBSD:
  4332. + * Copyright (C) 2020-2024 Hyperbola Project
  4333. + *
  4334. * Redistribution and use in source and binary forms, with or without
  4335. * modification, are permitted provided that the following conditions
  4336. * are met:
  4337. @@ -132,6 +135,7 @@ const (
  4338. ELFOSABI_OPENBSD OSABI = 12 /* OpenBSD */
  4339. ELFOSABI_OPENVMS OSABI = 13 /* Open VMS */
  4340. ELFOSABI_NSK OSABI = 14 /* HP Non-Stop Kernel */
  4341. + ELFOSABI_HYPERBOLABSD OSABI = 19 /* HyperbolaBSD */
  4342. ELFOSABI_ARM OSABI = 97 /* ARM */
  4343. ELFOSABI_STANDALONE OSABI = 255 /* Standalone (embedded) application */
  4344. )
  4345. @@ -152,6 +156,7 @@ var osabiStrings = []intName{
  4346. {12, "ELFOSABI_OPENBSD"},
  4347. {13, "ELFOSABI_OPENVMS"},
  4348. {14, "ELFOSABI_NSK"},
  4349. + {19, "ELFOSABI_HYPERBOLABSD"},
  4350. {97, "ELFOSABI_ARM"},
  4351. {255, "ELFOSABI_STANDALONE"},
  4352. }
  4353. diff --git a/libgo/go/debug/elf/file_test.go b/libgo/go/debug/elf/file_test.go
  4354. index 58bdf27..978f05e 100644
  4355. --- a/libgo/go/debug/elf/file_test.go
  4356. +++ b/libgo/go/debug/elf/file_test.go
  4357. @@ -1,4 +1,8 @@
  4358. // Copyright 2009 The Go Authors. All rights reserved.
  4359. +//
  4360. +// Modifications to support HyperbolaBSD:
  4361. +// Copyright (C) 2024 Hyperbola Project
  4362. +//
  4363. // Use of this source code is governed by a BSD-style
  4364. // license that can be found in the LICENSE file.
  4365. @@ -613,6 +617,35 @@ var relocationTests = []relocationTest{
  4366. }},
  4367. },
  4368. },
  4369. + {
  4370. + "testdata/gcc-amd64-hyperbolabsd-debug-with-rela.obj",
  4371. + []relocationTestEntry{
  4372. + {203, &dwarf.Entry{
  4373. + Offset: 0xc62,
  4374. + Tag: dwarf.TagMember,
  4375. + Children: false,
  4376. + Field: []dwarf.Field{
  4377. + {Attr: dwarf.AttrName, Val: "it_interval", Class: dwarf.ClassString},
  4378. + {Attr: dwarf.AttrDeclFile, Val: int64(7), Class: dwarf.ClassConstant},
  4379. + {Attr: dwarf.AttrDeclLine, Val: int64(236), Class: dwarf.ClassConstant},
  4380. + {Attr: dwarf.AttrType, Val: dwarf.Offset(0xb7f), Class: dwarf.ClassReference},
  4381. + {Attr: dwarf.AttrDataMemberLoc, Val: []byte{0x23, 0x0}, Class: dwarf.ClassExprLoc},
  4382. + },
  4383. + }},
  4384. + {204, &dwarf.Entry{
  4385. + Offset: 0xc70,
  4386. + Tag: dwarf.TagMember,
  4387. + Children: false,
  4388. + Field: []dwarf.Field{
  4389. + {Attr: dwarf.AttrName, Val: "it_value", Class: dwarf.ClassString},
  4390. + {Attr: dwarf.AttrDeclFile, Val: int64(7), Class: dwarf.ClassConstant},
  4391. + {Attr: dwarf.AttrDeclLine, Val: int64(237), Class: dwarf.ClassConstant},
  4392. + {Attr: dwarf.AttrType, Val: dwarf.Offset(0xb7f), Class: dwarf.ClassReference},
  4393. + {Attr: dwarf.AttrDataMemberLoc, Val: []byte{0x23, 0x10}, Class: dwarf.ClassExprLoc},
  4394. + },
  4395. + }},
  4396. + },
  4397. + },
  4398. }
  4399. func TestDWARFRelocations(t *testing.T) {
  4400. diff --git b/libgo/go/debug/elf/testdata/gcc-amd64-hyperbolabsd-debug-with-rela.obj b/libgo/go/debug/elf/testdata/gcc-amd64-hyperbolabsd-debug-with-rela.obj
  4401. new file mode 100644
  4402. index 0000000..f62b1ea
  4403. Binary files /dev/null and b/libgo/go/debug/elf/testdata/gcc-amd64-hyperbolabsd-debug-with-rela.obj differ
  4404. diff --git a/libgo/go/debug/gosym/pclntab_test.go b/libgo/go/debug/gosym/pclntab_test.go
  4405. index 7e7cee6..89d157e 100644
  4406. --- a/libgo/go/debug/gosym/pclntab_test.go
  4407. +++ b/libgo/go/debug/gosym/pclntab_test.go
  4408. @@ -1,4 +1,8 @@
  4409. // Copyright 2009 The Go Authors. All rights reserved.
  4410. +//
  4411. +// Modifications to support HyperbolaBSD:
  4412. +// Copyright (C) 2020-2024 Hyperbola Project
  4413. +//
  4414. // Use of this source code is governed by a BSD-style
  4415. // license that can be found in the LICENSE file.
  4416. @@ -79,7 +83,7 @@ func endtest() {
  4417. // These tests open and examine the test binary, and use elf.Open to do so.
  4418. func skipIfNotELF(t *testing.T) {
  4419. switch runtime.GOOS {
  4420. - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris":
  4421. + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd", "solaris":
  4422. // OK.
  4423. default:
  4424. t.Skipf("skipping on non-ELF system %s", runtime.GOOS)
  4425. diff --git a/libgo/go/go/build/syslist.go b/libgo/go/go/build/syslist.go
  4426. index 679d195..1ab5ee5 100644
  4427. --- a/libgo/go/go/build/syslist.go
  4428. +++ b/libgo/go/go/build/syslist.go
  4429. @@ -1,8 +1,12 @@
  4430. // Copyright 2011 The Go Authors. All rights reserved.
  4431. +//
  4432. +// Modifications to support HyperbolaBSD:
  4433. +// Copyright (C) 2020-2024 Hyperbola Project
  4434. +//
  4435. // Use of this source code is governed by a BSD-style
  4436. // license that can be found in the LICENSE file.
  4437. package build
  4438. -const goosList = "aix android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows zos "
  4439. +const goosList = "aix android darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd plan9 solaris windows zos "
  4440. const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be alpha m68k ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc riscv64 s390 s390x sh shbe sparc sparc64"
  4441. diff --git a/libgo/go/golang_org/x/net/internal/nettest/helper_bsd.go b/libgo/go/golang_org/x/net/internal/nettest/helper_bsd.go
  4442. index a6e433b..9e9b5b2 100644
  4443. --- a/libgo/go/golang_org/x/net/internal/nettest/helper_bsd.go
  4444. +++ b/libgo/go/golang_org/x/net/internal/nettest/helper_bsd.go
  4445. @@ -1,8 +1,12 @@
  4446. // Copyright 2016 The Go Authors. All rights reserved.
  4447. +//
  4448. +// Modifications to support HyperbolaBSD:
  4449. +// Copyright (C) 2020-2024 Hyperbola Project
  4450. +//
  4451. // Use of this source code is governed by a BSD-style
  4452. // license that can be found in the LICENSE file.
  4453. -// +build darwin dragonfly freebsd netbsd openbsd
  4454. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4455. package nettest
  4456. diff --git a/libgo/go/golang_org/x/net/internal/nettest/helper_posix.go b/libgo/go/golang_org/x/net/internal/nettest/helper_posix.go
  4457. index efc67a8..1f1dbcd 100644
  4458. --- a/libgo/go/golang_org/x/net/internal/nettest/helper_posix.go
  4459. +++ b/libgo/go/golang_org/x/net/internal/nettest/helper_posix.go
  4460. @@ -1,8 +1,12 @@
  4461. // Copyright 2014 The Go Authors. All rights reserved.
  4462. +//
  4463. +// Modifications to support HyperbolaBSD:
  4464. +// Copyright (C) 2020-2024 Hyperbola Project
  4465. +//
  4466. // Use of this source code is governed by a BSD-style
  4467. // license that can be found in the LICENSE file.
  4468. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
  4469. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris windows
  4470. package nettest
  4471. diff --git a/libgo/go/golang_org/x/net/internal/nettest/helper_unix.go b/libgo/go/golang_org/x/net/internal/nettest/helper_unix.go
  4472. index b6839dc..8df875b 100644
  4473. --- a/libgo/go/golang_org/x/net/internal/nettest/helper_unix.go
  4474. +++ b/libgo/go/golang_org/x/net/internal/nettest/helper_unix.go
  4475. @@ -1,8 +1,12 @@
  4476. // Copyright 2015 The Go Authors. All rights reserved.
  4477. +//
  4478. +// Modifications to support HyperbolaBSD:
  4479. +// Copyright (C) 2020-2024 Hyperbola Project
  4480. +//
  4481. // Use of this source code is governed by a BSD-style
  4482. // license that can be found in the LICENSE file.
  4483. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  4484. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  4485. package nettest
  4486. diff --git a/libgo/go/golang_org/x/net/route/address.go b/libgo/go/golang_org/x/net/route/address.go
  4487. index e6bfa39..874fb3b 100644
  4488. --- a/libgo/go/golang_org/x/net/route/address.go
  4489. +++ b/libgo/go/golang_org/x/net/route/address.go
  4490. @@ -1,8 +1,12 @@
  4491. // Copyright 2016 The Go Authors. All rights reserved.
  4492. +//
  4493. +// Modifications to support HyperbolaBSD:
  4494. +// Copyright (C) 2020-2024 Hyperbola Project
  4495. +//
  4496. // Use of this source code is governed by a BSD-style
  4497. // license that can be found in the LICENSE file.
  4498. -// +build darwin dragonfly freebsd netbsd openbsd
  4499. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4500. package route
  4501. diff --git a/libgo/go/golang_org/x/net/route/address_test.go b/libgo/go/golang_org/x/net/route/address_test.go
  4502. index 2005ef7..a891882 100644
  4503. --- a/libgo/go/golang_org/x/net/route/address_test.go
  4504. +++ b/libgo/go/golang_org/x/net/route/address_test.go
  4505. @@ -1,8 +1,12 @@
  4506. // Copyright 2016 The Go Authors. All rights reserved.
  4507. +//
  4508. +// Modifications to support HyperbolaBSD:
  4509. +// Copyright (C) 2020-2024 Hyperbola Project
  4510. +//
  4511. // Use of this source code is governed by a BSD-style
  4512. // license that can be found in the LICENSE file.
  4513. -// +build darwin dragonfly freebsd netbsd openbsd
  4514. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4515. package route
  4516. diff --git a/libgo/go/golang_org/x/net/route/binary.go b/libgo/go/golang_org/x/net/route/binary.go
  4517. index 6910520..0f2cf50 100644
  4518. --- a/libgo/go/golang_org/x/net/route/binary.go
  4519. +++ b/libgo/go/golang_org/x/net/route/binary.go
  4520. @@ -1,8 +1,12 @@
  4521. // Copyright 2016 The Go Authors. All rights reserved.
  4522. +//
  4523. +// Modifications to support HyperbolaBSD:
  4524. +// Copyright (C) 2020-2024 Hyperbola Project
  4525. +//
  4526. // Use of this source code is governed by a BSD-style
  4527. // license that can be found in the LICENSE file.
  4528. -// +build darwin dragonfly freebsd netbsd openbsd
  4529. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4530. package route
  4531. diff --git b/libgo/go/golang_org/x/net/route/defs_hyperbolabsd.go b/libgo/go/golang_org/x/net/route/defs_hyperbolabsd.go
  4532. new file mode 100644
  4533. index 0000000..47d089b
  4534. --- /dev/null
  4535. +++ b/libgo/go/golang_org/x/net/route/defs_hyperbolabsd.go
  4536. @@ -0,0 +1,120 @@
  4537. +// Copyright 2016 The Go Authors. All rights reserved.
  4538. +//
  4539. +// Modifications to support HyperbolaBSD:
  4540. +// Copyright (C) 2020-2024 Hyperbola Project
  4541. +//
  4542. +// Use of this source code is governed by a BSD-style
  4543. +// license that can be found in the LICENSE file.
  4544. +
  4545. +// +build ignore
  4546. +
  4547. +package route
  4548. +
  4549. +/*
  4550. +#include <sys/socket.h>
  4551. +#include <sys/sysctl.h>
  4552. +
  4553. +#include <net/if.h>
  4554. +#include <net/if_dl.h>
  4555. +#include <net/route.h>
  4556. +
  4557. +#include <netinet/in.h>
  4558. +*/
  4559. +import "C"
  4560. +
  4561. +const (
  4562. + sysAF_UNSPEC = C.AF_UNSPEC
  4563. + sysAF_INET = C.AF_INET
  4564. + sysAF_ROUTE = C.AF_ROUTE
  4565. + sysAF_LINK = C.AF_LINK
  4566. + sysAF_INET6 = C.AF_INET6
  4567. +
  4568. + sysSOCK_RAW = C.SOCK_RAW
  4569. +
  4570. + sysNET_RT_DUMP = C.NET_RT_DUMP
  4571. + sysNET_RT_FLAGS = C.NET_RT_FLAGS
  4572. + sysNET_RT_IFLIST = C.NET_RT_IFLIST
  4573. + sysNET_RT_STATS = C.NET_RT_STATS
  4574. + sysNET_RT_TABLE = C.NET_RT_TABLE
  4575. + sysNET_RT_IFNAMES = C.NET_RT_IFNAMES
  4576. + sysNET_RT_MAXID = C.NET_RT_MAXID
  4577. +)
  4578. +
  4579. +const (
  4580. + sysCTL_MAXNAME = C.CTL_MAXNAME
  4581. +
  4582. + sysCTL_UNSPEC = C.CTL_UNSPEC
  4583. + sysCTL_KERN = C.CTL_KERN
  4584. + sysCTL_VM = C.CTL_VM
  4585. + sysCTL_FS = C.CTL_FS
  4586. + sysCTL_NET = C.CTL_NET
  4587. + sysCTL_DEBUG = C.CTL_DEBUG
  4588. + sysCTL_HW = C.CTL_HW
  4589. + sysCTL_MACHDEP = C.CTL_MACHDEP
  4590. + sysCTL_DDB = C.CTL_DDB
  4591. + sysCTL_VFS = C.CTL_VFS
  4592. + sysCTL_MAXID = C.CTL_MAXID
  4593. +)
  4594. +
  4595. +const (
  4596. + sysRTM_VERSION = C.RTM_VERSION
  4597. +
  4598. + sysRTM_ADD = C.RTM_ADD
  4599. + sysRTM_DELETE = C.RTM_DELETE
  4600. + sysRTM_CHANGE = C.RTM_CHANGE
  4601. + sysRTM_GET = C.RTM_GET
  4602. + sysRTM_LOSING = C.RTM_LOSING
  4603. + sysRTM_REDIRECT = C.RTM_REDIRECT
  4604. + sysRTM_MISS = C.RTM_MISS
  4605. + sysRTM_LOCK = C.RTM_LOCK
  4606. + sysRTM_RESOLVE = C.RTM_RESOLVE
  4607. + sysRTM_NEWADDR = C.RTM_NEWADDR
  4608. + sysRTM_DELADDR = C.RTM_DELADDR
  4609. + sysRTM_IFINFO = C.RTM_IFINFO
  4610. + sysRTM_IFANNOUNCE = C.RTM_IFANNOUNCE
  4611. + sysRTM_DESYNC = C.RTM_DESYNC
  4612. + sysRTM_INVALIDATE = C.RTM_INVALIDATE
  4613. + sysRTM_BFD = C.RTM_BFD
  4614. + sysRTM_PROPOSAL = C.RTM_PROPOSAL
  4615. +
  4616. + sysRTA_DST = C.RTA_DST
  4617. + sysRTA_GATEWAY = C.RTA_GATEWAY
  4618. + sysRTA_NETMASK = C.RTA_NETMASK
  4619. + sysRTA_GENMASK = C.RTA_GENMASK
  4620. + sysRTA_IFP = C.RTA_IFP
  4621. + sysRTA_IFA = C.RTA_IFA
  4622. + sysRTA_AUTHOR = C.RTA_AUTHOR
  4623. + sysRTA_BRD = C.RTA_BRD
  4624. + sysRTA_SRC = C.RTA_SRC
  4625. + sysRTA_SRCMASK = C.RTA_SRCMASK
  4626. + sysRTA_LABEL = C.RTA_LABEL
  4627. + sysRTA_BFD = C.RTA_BFD
  4628. + sysRTA_DNS = C.RTA_DNS
  4629. + sysRTA_STATIC = C.RTA_STATIC
  4630. + sysRTA_SEARCH = C.RTA_SEARCH
  4631. +
  4632. + sysRTAX_DST = C.RTAX_DST
  4633. + sysRTAX_GATEWAY = C.RTAX_GATEWAY
  4634. + sysRTAX_NETMASK = C.RTAX_NETMASK
  4635. + sysRTAX_GENMASK = C.RTAX_GENMASK
  4636. + sysRTAX_IFP = C.RTAX_IFP
  4637. + sysRTAX_IFA = C.RTAX_IFA
  4638. + sysRTAX_AUTHOR = C.RTAX_AUTHOR
  4639. + sysRTAX_BRD = C.RTAX_BRD
  4640. + sysRTAX_SRC = C.RTAX_SRC
  4641. + sysRTAX_SRCMASK = C.RTAX_SRCMASK
  4642. + sysRTAX_LABEL = C.RTAX_LABEL
  4643. + sysRTAX_BFD = C.RTAX_BFD
  4644. + sysRTAX_DNS = C.RTAX_DNS
  4645. + sysRTAX_STATIC = C.RTAX_STATIC
  4646. + sysRTAX_SEARCH = C.RTAX_SEARCH
  4647. + sysRTAX_MAX = C.RTAX_MAX
  4648. +)
  4649. +
  4650. +const (
  4651. + sizeofRtMsghdr = C.sizeof_struct_rt_msghdr
  4652. +
  4653. + sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
  4654. + sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
  4655. + sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
  4656. +)
  4657. diff --git a/libgo/go/golang_org/x/net/route/interface.go b/libgo/go/golang_org/x/net/route/interface.go
  4658. index 854906d..3213e64 100644
  4659. --- a/libgo/go/golang_org/x/net/route/interface.go
  4660. +++ b/libgo/go/golang_org/x/net/route/interface.go
  4661. @@ -1,8 +1,12 @@
  4662. // Copyright 2016 The Go Authors. All rights reserved.
  4663. +//
  4664. +// Modifications to support HyperbolaBSD:
  4665. +// Copyright (C) 2020-2024 Hyperbola Project
  4666. +//
  4667. // Use of this source code is governed by a BSD-style
  4668. // license that can be found in the LICENSE file.
  4669. -// +build darwin dragonfly freebsd netbsd openbsd
  4670. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4671. package route
  4672. diff --git b/libgo/go/golang_org/x/net/route/interface_hyperbolabsd.go b/libgo/go/golang_org/x/net/route/interface_hyperbolabsd.go
  4673. new file mode 100644
  4674. index 0000000..11dd5c8
  4675. --- /dev/null
  4676. +++ b/libgo/go/golang_org/x/net/route/interface_hyperbolabsd.go
  4677. @@ -0,0 +1,94 @@
  4678. +// Copyright 2016 The Go Authors. All rights reserved.
  4679. +//
  4680. +// Modifications to support HyperbolaBSD:
  4681. +// Copyright (C) 2020-2024 Hyperbola Project
  4682. +//
  4683. +// Use of this source code is governed by a BSD-style
  4684. +// license that can be found in the LICENSE file.
  4685. +
  4686. +package route
  4687. +
  4688. +func (*wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
  4689. + if len(b) < 32 {
  4690. + return nil, errMessageTooShort
  4691. + }
  4692. + l := int(nativeEndian.Uint16(b[:2]))
  4693. + if len(b) < l {
  4694. + return nil, errInvalidMessage
  4695. + }
  4696. + attrs := uint(nativeEndian.Uint32(b[12:16]))
  4697. + if attrs&sysRTA_IFP == 0 {
  4698. + return nil, nil
  4699. + }
  4700. + m := &InterfaceMessage{
  4701. + Version: int(b[2]),
  4702. + Type: int(b[3]),
  4703. + Flags: int(nativeEndian.Uint32(b[16:20])),
  4704. + Index: int(nativeEndian.Uint16(b[6:8])),
  4705. + Addrs: make([]Addr, sysRTAX_MAX),
  4706. + raw: b[:l],
  4707. + }
  4708. + ll := int(nativeEndian.Uint16(b[4:6]))
  4709. + if len(b) < ll {
  4710. + return nil, errInvalidMessage
  4711. + }
  4712. + a, err := parseLinkAddr(b[ll:])
  4713. + if err != nil {
  4714. + return nil, err
  4715. + }
  4716. + m.Addrs[sysRTAX_IFP] = a
  4717. + m.Name = a.(*LinkAddr).Name
  4718. + return m, nil
  4719. +}
  4720. +
  4721. +func (*wireFormat) parseInterfaceAddrMessage(_ RIBType, b []byte) (Message, error) {
  4722. + if len(b) < 24 {
  4723. + return nil, errMessageTooShort
  4724. + }
  4725. + l := int(nativeEndian.Uint16(b[:2]))
  4726. + if len(b) < l {
  4727. + return nil, errInvalidMessage
  4728. + }
  4729. + bodyOff := int(nativeEndian.Uint16(b[4:6]))
  4730. + if len(b) < bodyOff {
  4731. + return nil, errInvalidMessage
  4732. + }
  4733. + m := &InterfaceAddrMessage{
  4734. + Version: int(b[2]),
  4735. + Type: int(b[3]),
  4736. + Flags: int(nativeEndian.Uint32(b[12:16])),
  4737. + Index: int(nativeEndian.Uint16(b[6:8])),
  4738. + raw: b[:l],
  4739. + }
  4740. + var err error
  4741. + m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[12:16])), parseKernelInetAddr, b[bodyOff:])
  4742. + if err != nil {
  4743. + return nil, err
  4744. + }
  4745. + return m, nil
  4746. +}
  4747. +
  4748. +func (*wireFormat) parseInterfaceAnnounceMessage(_ RIBType, b []byte) (Message, error) {
  4749. + if len(b) < 26 {
  4750. + return nil, errMessageTooShort
  4751. + }
  4752. + l := int(nativeEndian.Uint16(b[:2]))
  4753. + if len(b) < l {
  4754. + return nil, errInvalidMessage
  4755. + }
  4756. + m := &InterfaceAnnounceMessage{
  4757. + Version: int(b[2]),
  4758. + Type: int(b[3]),
  4759. + Index: int(nativeEndian.Uint16(b[6:8])),
  4760. + What: int(nativeEndian.Uint16(b[8:10])),
  4761. + raw: b[:l],
  4762. + }
  4763. + for i := 0; i < 16; i++ {
  4764. + if b[10+i] != 0 {
  4765. + continue
  4766. + }
  4767. + m.Name = string(b[10 : 10+i])
  4768. + break
  4769. + }
  4770. + return m, nil
  4771. +}
  4772. diff --git a/libgo/go/golang_org/x/net/route/message.go b/libgo/go/golang_org/x/net/route/message.go
  4773. index 0fa7e09..e35a27f 100644
  4774. --- a/libgo/go/golang_org/x/net/route/message.go
  4775. +++ b/libgo/go/golang_org/x/net/route/message.go
  4776. @@ -1,8 +1,12 @@
  4777. // Copyright 2016 The Go Authors. All rights reserved.
  4778. +//
  4779. +// Modifications to support HyperbolaBSD:
  4780. +// Copyright (C) 2020-2024 Hyperbola Project
  4781. +//
  4782. // Use of this source code is governed by a BSD-style
  4783. // license that can be found in the LICENSE file.
  4784. -// +build darwin dragonfly freebsd netbsd openbsd
  4785. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4786. package route
  4787. diff --git a/libgo/go/golang_org/x/net/route/message_test.go b/libgo/go/golang_org/x/net/route/message_test.go
  4788. index e848dab..d40796a 100644
  4789. --- a/libgo/go/golang_org/x/net/route/message_test.go
  4790. +++ b/libgo/go/golang_org/x/net/route/message_test.go
  4791. @@ -1,8 +1,12 @@
  4792. // Copyright 2016 The Go Authors. All rights reserved.
  4793. +//
  4794. +// Modifications to support HyperbolaBSD:
  4795. +// Copyright (C) 2020-2024 Hyperbola Project
  4796. +//
  4797. // Use of this source code is governed by a BSD-style
  4798. // license that can be found in the LICENSE file.
  4799. -// +build darwin dragonfly freebsd netbsd openbsd
  4800. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4801. package route
  4802. diff --git a/libgo/go/golang_org/x/net/route/route.go b/libgo/go/golang_org/x/net/route/route.go
  4803. index 081da0d..659051c 100644
  4804. --- a/libgo/go/golang_org/x/net/route/route.go
  4805. +++ b/libgo/go/golang_org/x/net/route/route.go
  4806. @@ -1,15 +1,19 @@
  4807. // Copyright 2016 The Go Authors. All rights reserved.
  4808. +//
  4809. +// Modifications to support HyperbolaBSD:
  4810. +// Copyright (C) 2020-2024 Hyperbola Project
  4811. +//
  4812. // Use of this source code is governed by a BSD-style
  4813. // license that can be found in the LICENSE file.
  4814. -// +build darwin dragonfly freebsd netbsd openbsd
  4815. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4816. // Package route provides basic functions for the manipulation of
  4817. // packet routing facilities on BSD variants.
  4818. //
  4819. // The package supports any version of Darwin, any version of
  4820. -// DragonFly BSD, FreeBSD 7 through 11, NetBSD 6 and above, and
  4821. -// OpenBSD 5.6 and above.
  4822. +// DragonFly BSD, FreeBSD 7 through 11, NetBSD 6 and above,
  4823. +// OpenBSD 5.6 and above, and HyperbolaBSD.
  4824. package route
  4825. import (
  4826. diff --git b/libgo/go/golang_org/x/net/route/route_hyperbolabsd.go b/libgo/go/golang_org/x/net/route/route_hyperbolabsd.go
  4827. new file mode 100644
  4828. index 0000000..7c33b20
  4829. --- /dev/null
  4830. +++ b/libgo/go/golang_org/x/net/route/route_hyperbolabsd.go
  4831. @@ -0,0 +1,69 @@
  4832. +// Copyright 2016 The Go Authors. All rights reserved.
  4833. +//
  4834. +// Modifications to support HyperbolaBSD:
  4835. +// Copyright (C) 2020-2024 Hyperbola Project
  4836. +//
  4837. +// Use of this source code is governed by a BSD-style
  4838. +// license that can be found in the LICENSE file.
  4839. +
  4840. +package route
  4841. +
  4842. +import "syscall"
  4843. +
  4844. +func (m *RouteMessage) marshal() ([]byte, error) {
  4845. + l := sizeofRtMsghdr + addrsSpace(m.Addrs)
  4846. + b := make([]byte, l)
  4847. + nativeEndian.PutUint16(b[:2], uint16(l))
  4848. + if m.Version == 0 {
  4849. + b[2] = sysRTM_VERSION
  4850. + } else {
  4851. + b[2] = byte(m.Version)
  4852. + }
  4853. + b[3] = byte(m.Type)
  4854. + nativeEndian.PutUint16(b[4:6], uint16(sizeofRtMsghdr))
  4855. + nativeEndian.PutUint32(b[16:20], uint32(m.Flags))
  4856. + nativeEndian.PutUint16(b[6:8], uint16(m.Index))
  4857. + nativeEndian.PutUint32(b[24:28], uint32(m.ID))
  4858. + nativeEndian.PutUint32(b[28:32], uint32(m.Seq))
  4859. + attrs, err := marshalAddrs(b[sizeofRtMsghdr:], m.Addrs)
  4860. + if err != nil {
  4861. + return nil, err
  4862. + }
  4863. + if attrs > 0 {
  4864. + nativeEndian.PutUint32(b[12:16], uint32(attrs))
  4865. + }
  4866. + return b, nil
  4867. +}
  4868. +
  4869. +func (*wireFormat) parseRouteMessage(_ RIBType, b []byte) (Message, error) {
  4870. + if len(b) < sizeofRtMsghdr {
  4871. + return nil, errMessageTooShort
  4872. + }
  4873. + l := int(nativeEndian.Uint16(b[:2]))
  4874. + if len(b) < l {
  4875. + return nil, errInvalidMessage
  4876. + }
  4877. + m := &RouteMessage{
  4878. + Version: int(b[2]),
  4879. + Type: int(b[3]),
  4880. + Flags: int(nativeEndian.Uint32(b[16:20])),
  4881. + Index: int(nativeEndian.Uint16(b[6:8])),
  4882. + ID: uintptr(nativeEndian.Uint32(b[24:28])),
  4883. + Seq: int(nativeEndian.Uint32(b[28:32])),
  4884. + raw: b[:l],
  4885. + }
  4886. + ll := int(nativeEndian.Uint16(b[4:6]))
  4887. + if len(b) < ll {
  4888. + return nil, errInvalidMessage
  4889. + }
  4890. + errno := syscall.Errno(nativeEndian.Uint32(b[32:36]))
  4891. + if errno != 0 {
  4892. + m.Err = errno
  4893. + }
  4894. + as, err := parseAddrs(uint(nativeEndian.Uint32(b[12:16])), parseKernelInetAddr, b[ll:])
  4895. + if err != nil {
  4896. + return nil, err
  4897. + }
  4898. + m.Addrs = as
  4899. + return m, nil
  4900. +}
  4901. diff --git a/libgo/go/golang_org/x/net/route/route_test.go b/libgo/go/golang_org/x/net/route/route_test.go
  4902. index 61bd174..09b3219 100644
  4903. --- a/libgo/go/golang_org/x/net/route/route_test.go
  4904. +++ b/libgo/go/golang_org/x/net/route/route_test.go
  4905. @@ -1,8 +1,12 @@
  4906. // Copyright 2016 The Go Authors. All rights reserved.
  4907. +//
  4908. +// Modifications to support HyperbolaBSD:
  4909. +// Copyright (C) 2020-2024 Hyperbola Project
  4910. +//
  4911. // Use of this source code is governed by a BSD-style
  4912. // license that can be found in the LICENSE file.
  4913. -// +build darwin dragonfly freebsd netbsd openbsd
  4914. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4915. package route
  4916. @@ -21,6 +25,8 @@ func (m *InterfaceMessage) String() string {
  4917. var attrs addrAttrs
  4918. if runtime.GOOS == "openbsd" {
  4919. attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4920. + } else if runtime.GOOS == "hyperbolabsd" {
  4921. + attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4922. } else {
  4923. attrs = addrAttrs(nativeEndian.Uint32(m.raw[4:8]))
  4924. }
  4925. @@ -31,6 +37,8 @@ func (m *InterfaceAddrMessage) String() string {
  4926. var attrs addrAttrs
  4927. if runtime.GOOS == "openbsd" {
  4928. attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4929. + } else if runtime.GOOS == "hyperbolabsd" {
  4930. + attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4931. } else {
  4932. attrs = addrAttrs(nativeEndian.Uint32(m.raw[4:8]))
  4933. }
  4934. @@ -71,13 +79,13 @@ var addrAttrNames = [...]string{
  4935. "ifa",
  4936. "author",
  4937. "brd",
  4938. - "df:mpls1-n:tag-o:src", // mpls1 for dragonfly, tag for netbsd, src for openbsd
  4939. - "df:mpls2-o:srcmask", // mpls2 for dragonfly, srcmask for openbsd
  4940. - "df:mpls3-o:label", // mpls3 for dragonfly, label for openbsd
  4941. - "o:bfd", // bfd for openbsd
  4942. - "o:dns", // dns for openbsd
  4943. - "o:static", // static for openbsd
  4944. - "o:search", // search for openbsd
  4945. + "df:mpls1-n:tag-o:src-hb:src", // mpls1 for dragonfly, tag for netbsd, src for openbsd (and hyperbolabsd)
  4946. + "df:mpls2-o:srcmask-hb:srcmask", // mpls2 for dragonfly, srcmask for openbsd (and hyperbolabsd)
  4947. + "df:mpls3-o:label-hb:label;", // mpls3 for dragonfly, label for openbsd (and hyperbolabsd)
  4948. + "o:bfd-hb:bfd", // bfd for openbsd (and hyperbolabsd)
  4949. + "o:dns-hb:dns", // dns for openbsd (and hyperbolabsd)
  4950. + "o:static-hb:static", // static for openbsd (and hyperbolabsd)
  4951. + "o:search-hb:search", // search for openbsd (and hyperbolabsd)
  4952. }
  4953. func (attrs addrAttrs) String() string {
  4954. @@ -115,6 +123,8 @@ func (ms msgs) validate() ([]string, error) {
  4955. var attrs addrAttrs
  4956. if runtime.GOOS == "openbsd" {
  4957. attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4958. + } else if runtime.GOOS == "hyperbolabsd" {
  4959. + attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4960. } else {
  4961. attrs = addrAttrs(nativeEndian.Uint32(m.raw[4:8]))
  4962. }
  4963. @@ -130,6 +140,8 @@ func (ms msgs) validate() ([]string, error) {
  4964. var attrs addrAttrs
  4965. if runtime.GOOS == "openbsd" {
  4966. attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4967. + } else if runtime.GOOS == "hyperbolabsd" {
  4968. + attrs = addrAttrs(nativeEndian.Uint32(m.raw[12:16]))
  4969. } else {
  4970. attrs = addrAttrs(nativeEndian.Uint32(m.raw[4:8]))
  4971. }
  4972. @@ -359,6 +371,8 @@ func (pv *propVirtual) teardown() error {
  4973. func (pv *propVirtual) configure(suffix int) error {
  4974. if runtime.GOOS == "openbsd" {
  4975. pv.name = fmt.Sprintf("vether%d", suffix)
  4976. + } else if runtime.GOOS == "hyperbolabsd" {
  4977. + pv.name = fmt.Sprintf("vether%d", suffix)
  4978. } else {
  4979. pv.name = fmt.Sprintf("vlan%d", suffix)
  4980. }
  4981. diff --git a/libgo/go/golang_org/x/net/route/sys.go b/libgo/go/golang_org/x/net/route/sys.go
  4982. index 3d0ee9b..94a85e9 100644
  4983. --- a/libgo/go/golang_org/x/net/route/sys.go
  4984. +++ b/libgo/go/golang_org/x/net/route/sys.go
  4985. @@ -1,8 +1,12 @@
  4986. // Copyright 2016 The Go Authors. All rights reserved.
  4987. +//
  4988. +// Modifications to support HyperbolaBSD:
  4989. +// Copyright (C) 2020-2024 Hyperbola Project
  4990. +//
  4991. // Use of this source code is governed by a BSD-style
  4992. // license that can be found in the LICENSE file.
  4993. -// +build darwin dragonfly freebsd netbsd openbsd
  4994. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  4995. package route
  4996. diff --git b/libgo/go/golang_org/x/net/route/sys_hyperbolabsd.go b/libgo/go/golang_org/x/net/route/sys_hyperbolabsd.go
  4997. new file mode 100644
  4998. index 0000000..e6cb3ca
  4999. --- /dev/null
  5000. +++ b/libgo/go/golang_org/x/net/route/sys_hyperbolabsd.go
  5001. @@ -0,0 +1,84 @@
  5002. +// Copyright 2016 The Go Authors. All rights reserved.
  5003. +//
  5004. +// Modifications to support HyperbolaBSD:
  5005. +// Copyright (C) 2020-2024 Hyperbola Project
  5006. +//
  5007. +// Use of this source code is governed by a BSD-style
  5008. +// license that can be found in the LICENSE file.
  5009. +
  5010. +package route
  5011. +
  5012. +import "unsafe"
  5013. +
  5014. +func (typ RIBType) parseable() bool {
  5015. + switch typ {
  5016. + case sysNET_RT_STATS, sysNET_RT_TABLE:
  5017. + return false
  5018. + default:
  5019. + return true
  5020. + }
  5021. +}
  5022. +
  5023. +// RouteMetrics represents route metrics.
  5024. +type RouteMetrics struct {
  5025. + PathMTU int // path maximum transmission unit
  5026. +}
  5027. +
  5028. +// SysType implements the SysType method of Sys interface.
  5029. +func (rmx *RouteMetrics) SysType() SysType { return SysMetrics }
  5030. +
  5031. +// Sys implements the Sys method of Message interface.
  5032. +func (m *RouteMessage) Sys() []Sys {
  5033. + return []Sys{
  5034. + &RouteMetrics{
  5035. + PathMTU: int(nativeEndian.Uint32(m.raw[60:64])),
  5036. + },
  5037. + }
  5038. +}
  5039. +
  5040. +// InterfaceMetrics represents interface metrics.
  5041. +type InterfaceMetrics struct {
  5042. + Type int // interface type
  5043. + MTU int // maximum transmission unit
  5044. +}
  5045. +
  5046. +// SysType implements the SysType method of Sys interface.
  5047. +func (imx *InterfaceMetrics) SysType() SysType { return SysMetrics }
  5048. +
  5049. +// Sys implements the Sys method of Message interface.
  5050. +func (m *InterfaceMessage) Sys() []Sys {
  5051. + return []Sys{
  5052. + &InterfaceMetrics{
  5053. + Type: int(m.raw[24]),
  5054. + MTU: int(nativeEndian.Uint32(m.raw[28:32])),
  5055. + },
  5056. + }
  5057. +}
  5058. +
  5059. +func probeRoutingStack() (int, map[int]*wireFormat) {
  5060. + var p uintptr
  5061. + rtm := &wireFormat{extOff: -1, bodyOff: -1}
  5062. + rtm.parse = rtm.parseRouteMessage
  5063. + ifm := &wireFormat{extOff: -1, bodyOff: -1}
  5064. + ifm.parse = ifm.parseInterfaceMessage
  5065. + ifam := &wireFormat{extOff: -1, bodyOff: -1}
  5066. + ifam.parse = ifam.parseInterfaceAddrMessage
  5067. + ifanm := &wireFormat{extOff: -1, bodyOff: -1}
  5068. + ifanm.parse = ifanm.parseInterfaceAnnounceMessage
  5069. + return int(unsafe.Sizeof(p)), map[int]*wireFormat{
  5070. + sysRTM_ADD: rtm,
  5071. + sysRTM_DELETE: rtm,
  5072. + sysRTM_CHANGE: rtm,
  5073. + sysRTM_GET: rtm,
  5074. + sysRTM_LOSING: rtm,
  5075. + sysRTM_REDIRECT: rtm,
  5076. + sysRTM_MISS: rtm,
  5077. + sysRTM_LOCK: rtm,
  5078. + sysRTM_RESOLVE: rtm,
  5079. + sysRTM_NEWADDR: ifam,
  5080. + sysRTM_DELADDR: ifam,
  5081. + sysRTM_IFINFO: ifm,
  5082. + sysRTM_IFANNOUNCE: ifanm,
  5083. + sysRTM_DESYNC: rtm,
  5084. + }
  5085. +}
  5086. diff --git a/libgo/go/golang_org/x/net/route/syscall.go b/libgo/go/golang_org/x/net/route/syscall.go
  5087. index c211188..6a16d7f 100644
  5088. --- a/libgo/go/golang_org/x/net/route/syscall.go
  5089. +++ b/libgo/go/golang_org/x/net/route/syscall.go
  5090. @@ -1,8 +1,12 @@
  5091. // Copyright 2016 The Go Authors. All rights reserved.
  5092. +//
  5093. +// Modifications to support HyperbolaBSD:
  5094. +// Copyright (C) 2020-2024 Hyperbola Project
  5095. +//
  5096. // Use of this source code is governed by a BSD-style
  5097. // license that can be found in the LICENSE file.
  5098. -// +build darwin dragonfly freebsd netbsd openbsd
  5099. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  5100. package route
  5101. diff --git b/libgo/go/golang_org/x/net/route/zsys_hyperbolabsd.go b/libgo/go/golang_org/x/net/route/zsys_hyperbolabsd.go
  5102. new file mode 100644
  5103. index 0000000..d63ec70
  5104. --- /dev/null
  5105. +++ b/libgo/go/golang_org/x/net/route/zsys_hyperbolabsd.go
  5106. @@ -0,0 +1,101 @@
  5107. +// Created by cgo -godefs - DO NOT EDIT
  5108. +// cgo -godefs defs_hyperbolabsd.go
  5109. +
  5110. +package route
  5111. +
  5112. +const (
  5113. + sysAF_UNSPEC = 0x0
  5114. + sysAF_INET = 0x2
  5115. + sysAF_ROUTE = 0x11
  5116. + sysAF_LINK = 0x12
  5117. + sysAF_INET6 = 0x18
  5118. +
  5119. + sysSOCK_RAW = 0x3
  5120. +
  5121. + sysNET_RT_DUMP = 0x1
  5122. + sysNET_RT_FLAGS = 0x2
  5123. + sysNET_RT_IFLIST = 0x3
  5124. + sysNET_RT_STATS = 0x4
  5125. + sysNET_RT_TABLE = 0x5
  5126. + sysNET_RT_IFNAMES = 0x6
  5127. + sysNET_RT_MAXID = 0x7
  5128. +)
  5129. +
  5130. +const (
  5131. + sysCTL_MAXNAME = 0xc
  5132. +
  5133. + sysCTL_UNSPEC = 0x0
  5134. + sysCTL_KERN = 0x1
  5135. + sysCTL_VM = 0x2
  5136. + sysCTL_FS = 0x3
  5137. + sysCTL_NET = 0x4
  5138. + sysCTL_DEBUG = 0x5
  5139. + sysCTL_HW = 0x6
  5140. + sysCTL_MACHDEP = 0x7
  5141. + sysCTL_DDB = 0x9
  5142. + sysCTL_VFS = 0xa
  5143. + sysCTL_MAXID = 0xb
  5144. +)
  5145. +
  5146. +const (
  5147. + sysRTM_VERSION = 0x5
  5148. +
  5149. + sysRTM_ADD = 0x1
  5150. + sysRTM_DELETE = 0x2
  5151. + sysRTM_CHANGE = 0x3
  5152. + sysRTM_GET = 0x4
  5153. + sysRTM_LOSING = 0x5
  5154. + sysRTM_REDIRECT = 0x6
  5155. + sysRTM_MISS = 0x7
  5156. + sysRTM_LOCK = 0x8
  5157. + sysRTM_RESOLVE = 0xb
  5158. + sysRTM_NEWADDR = 0xc
  5159. + sysRTM_DELADDR = 0xd
  5160. + sysRTM_IFINFO = 0xe
  5161. + sysRTM_IFANNOUNCE = 0xf
  5162. + sysRTM_DESYNC = 0x10
  5163. + sysRTM_INVALIDATE = 0x11
  5164. + sysRTM_BFD = 0x12
  5165. + sysRTM_PROPOSAL = 0x13
  5166. +
  5167. + sysRTA_DST = 0x1
  5168. + sysRTA_GATEWAY = 0x2
  5169. + sysRTA_NETMASK = 0x4
  5170. + sysRTA_GENMASK = 0x8
  5171. + sysRTA_IFP = 0x10
  5172. + sysRTA_IFA = 0x20
  5173. + sysRTA_AUTHOR = 0x40
  5174. + sysRTA_BRD = 0x80
  5175. + sysRTA_SRC = 0x100
  5176. + sysRTA_SRCMASK = 0x200
  5177. + sysRTA_LABEL = 0x400
  5178. + sysRTA_BFD = 0x800
  5179. + sysRTA_DNS = 0x1000
  5180. + sysRTA_STATIC = 0x2000
  5181. + sysRTA_SEARCH = 0x4000
  5182. +
  5183. + sysRTAX_DST = 0x0
  5184. + sysRTAX_GATEWAY = 0x1
  5185. + sysRTAX_NETMASK = 0x2
  5186. + sysRTAX_GENMASK = 0x3
  5187. + sysRTAX_IFP = 0x4
  5188. + sysRTAX_IFA = 0x5
  5189. + sysRTAX_AUTHOR = 0x6
  5190. + sysRTAX_BRD = 0x7
  5191. + sysRTAX_SRC = 0x8
  5192. + sysRTAX_SRCMASK = 0x9
  5193. + sysRTAX_LABEL = 0xa
  5194. + sysRTAX_BFD = 0xb
  5195. + sysRTAX_DNS = 0xc
  5196. + sysRTAX_STATIC = 0xd
  5197. + sysRTAX_SEARCH = 0xe
  5198. + sysRTAX_MAX = 0xf
  5199. +)
  5200. +
  5201. +const (
  5202. + sizeofRtMsghdr = 0x60
  5203. +
  5204. + sizeofSockaddrStorage = 0x100
  5205. + sizeofSockaddrInet = 0x10
  5206. + sizeofSockaddrInet6 = 0x1c
  5207. +)
  5208. diff --git a/libgo/go/internal/poll/export_posix_test.go b/libgo/go/internal/poll/export_posix_test.go
  5209. index 6b9bb8b..71b4b17 100644
  5210. --- a/libgo/go/internal/poll/export_posix_test.go
  5211. +++ b/libgo/go/internal/poll/export_posix_test.go
  5212. @@ -1,8 +1,12 @@
  5213. // Copyright 2017 The Go Authors. All rights reserved.
  5214. +//
  5215. +// Modifications to support HyperbolaBSD:
  5216. +// Copyright (C) 2020-2024 Hyperbola Project
  5217. +//
  5218. // Use of this source code is governed by a BSD-style
  5219. // license that can be found in the LICENSE file.
  5220. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  5221. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  5222. // Export guts for testing on posix.
  5223. // Since testing imports os and os imports internal/poll,
  5224. diff --git a/libgo/go/internal/poll/fd_poll_runtime.go b/libgo/go/internal/poll/fd_poll_runtime.go
  5225. index b91cbe4..9453e61 100644
  5226. --- a/libgo/go/internal/poll/fd_poll_runtime.go
  5227. +++ b/libgo/go/internal/poll/fd_poll_runtime.go
  5228. @@ -1,8 +1,12 @@
  5229. // Copyright 2013 The Go Authors. All rights reserved.
  5230. +//
  5231. +// Modifications to support HyperbolaBSD:
  5232. +// Copyright (C) 2020-2024 Hyperbola Project
  5233. +//
  5234. // Use of this source code is governed by a BSD-style
  5235. // license that can be found in the LICENSE file.
  5236. -// +build aix darwin dragonfly freebsd linux netbsd openbsd windows solaris
  5237. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd windows solaris
  5238. package poll
  5239. diff --git a/libgo/go/internal/poll/fd_posix.go b/libgo/go/internal/poll/fd_posix.go
  5240. index 4e6e355..f3a52cb 100644
  5241. --- a/libgo/go/internal/poll/fd_posix.go
  5242. +++ b/libgo/go/internal/poll/fd_posix.go
  5243. @@ -1,8 +1,12 @@
  5244. // Copyright 2009 The Go Authors. All rights reserved.
  5245. +//
  5246. +// Modifications to support HyperbolaBSD:
  5247. +// Copyright (C) 2020-2024 Hyperbola Project
  5248. +//
  5249. // Use of this source code is governed by a BSD-style
  5250. // license that can be found in the LICENSE file.
  5251. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  5252. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  5253. package poll
  5254. diff --git a/libgo/go/internal/poll/fd_posix_test.go b/libgo/go/internal/poll/fd_posix_test.go
  5255. index 246d498..fc0efff 100644
  5256. --- a/libgo/go/internal/poll/fd_posix_test.go
  5257. +++ b/libgo/go/internal/poll/fd_posix_test.go
  5258. @@ -1,8 +1,12 @@
  5259. // Copyright 2012 The Go Authors. All rights reserved.
  5260. +//
  5261. +// Modifications to support HyperbolaBSD:
  5262. +// Copyright (C) 2020-2024 Hyperbola Project
  5263. +//
  5264. // Use of this source code is governed by a BSD-style
  5265. // license that can be found in the LICENSE file.
  5266. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  5267. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  5268. package poll_test
  5269. diff --git a/libgo/go/internal/poll/fd_unix.go b/libgo/go/internal/poll/fd_unix.go
  5270. index cfd441e..ba4d0e8 100644
  5271. --- a/libgo/go/internal/poll/fd_unix.go
  5272. +++ b/libgo/go/internal/poll/fd_unix.go
  5273. @@ -1,8 +1,12 @@
  5274. // Copyright 2017 The Go Authors. All rights reserved.
  5275. +//
  5276. +// Modifications to support HyperbolaBSD:
  5277. +// Copyright (C) 2020-2024 Hyperbola Project
  5278. +//
  5279. // Use of this source code is governed by a BSD-style
  5280. // license that can be found in the LICENSE file.
  5281. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  5282. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  5283. package poll
  5284. diff --git a/libgo/go/internal/poll/hook_unix.go b/libgo/go/internal/poll/hook_unix.go
  5285. index 4cf36cc..cb3c59f 100644
  5286. --- a/libgo/go/internal/poll/hook_unix.go
  5287. +++ b/libgo/go/internal/poll/hook_unix.go
  5288. @@ -1,8 +1,12 @@
  5289. // Copyright 2017 The Go Authors. All rights reserved.
  5290. +//
  5291. +// Modifications to support HyperbolaBSD:
  5292. +// Copyright (C) 2020-2024 Hyperbola Project
  5293. +//
  5294. // Use of this source code is governed by a BSD-style
  5295. // license that can be found in the LICENSE file.
  5296. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  5297. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  5298. package poll
  5299. diff --git a/libgo/go/internal/poll/sockopt.go b/libgo/go/internal/poll/sockopt.go
  5300. index bb5ea02..0eb50f8 100644
  5301. --- a/libgo/go/internal/poll/sockopt.go
  5302. +++ b/libgo/go/internal/poll/sockopt.go
  5303. @@ -1,8 +1,12 @@
  5304. // Copyright 2009 The Go Authors. All rights reserved.
  5305. +//
  5306. +// Modifications to support HyperbolaBSD:
  5307. +// Copyright (C) 2020-2024 Hyperbola Project
  5308. +//
  5309. // Use of this source code is governed by a BSD-style
  5310. // license that can be found in the LICENSE file.
  5311. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
  5312. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris windows
  5313. package poll
  5314. diff --git a/libgo/go/internal/poll/sockopt_unix.go b/libgo/go/internal/poll/sockopt_unix.go
  5315. index b33644d..6da6011 100644
  5316. --- a/libgo/go/internal/poll/sockopt_unix.go
  5317. +++ b/libgo/go/internal/poll/sockopt_unix.go
  5318. @@ -1,8 +1,12 @@
  5319. // Copyright 2017 The Go Authors. All rights reserved.
  5320. +//
  5321. +// Modifications to support HyperbolaBSD:
  5322. +// Copyright (C) 2020-2024 Hyperbola Project
  5323. +//
  5324. // Use of this source code is governed by a BSD-style
  5325. // license that can be found in the LICENSE file.
  5326. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  5327. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5328. package poll
  5329. diff --git a/libgo/go/internal/poll/sockoptip.go b/libgo/go/internal/poll/sockoptip.go
  5330. index c55a1e3..6599a1a 100644
  5331. --- a/libgo/go/internal/poll/sockoptip.go
  5332. +++ b/libgo/go/internal/poll/sockoptip.go
  5333. @@ -1,8 +1,12 @@
  5334. // Copyright 2011 The Go Authors. All rights reserved.
  5335. +//
  5336. +// Modifications to support HyperbolaBSD:
  5337. +// Copyright (C) 2020-2024 Hyperbola Project
  5338. +//
  5339. // Use of this source code is governed by a BSD-style
  5340. // license that can be found in the LICENSE file.
  5341. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
  5342. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris windows
  5343. package poll
  5344. diff --git a/libgo/go/internal/poll/sys_cloexec.go b/libgo/go/internal/poll/sys_cloexec.go
  5345. index fb5f2bc..5a8a9ad 100644
  5346. --- a/libgo/go/internal/poll/sys_cloexec.go
  5347. +++ b/libgo/go/internal/poll/sys_cloexec.go
  5348. @@ -1,11 +1,15 @@
  5349. // Copyright 2013 The Go Authors. All rights reserved.
  5350. +//
  5351. +// Modifications to support HyperbolaBSD:
  5352. +// Copyright (C) 2020-2024 Hyperbola Project
  5353. +//
  5354. // Use of this source code is governed by a BSD-style
  5355. // license that can be found in the LICENSE file.
  5356. // This file implements sysSocket and accept for platforms that do not
  5357. // provide a fast path for setting SetNonblock and CloseOnExec.
  5358. -// +build aix darwin nacl netbsd openbsd solaris
  5359. +// +build aix darwin nacl netbsd openbsd hyperbolabsd solaris
  5360. package poll
  5361. diff --git a/libgo/go/internal/poll/writev.go b/libgo/go/internal/poll/writev.go
  5362. index 4bf8804..ef593d3 100644
  5363. --- a/libgo/go/internal/poll/writev.go
  5364. +++ b/libgo/go/internal/poll/writev.go
  5365. @@ -1,8 +1,12 @@
  5366. // Copyright 2016 The Go Authors. All rights reserved.
  5367. +//
  5368. +// Modifications to support HyperbolaBSD:
  5369. +// Copyright (C) 2020-2024 Hyperbola Project
  5370. +//
  5371. // Use of this source code is governed by a BSD-style
  5372. // license that can be found in the LICENSE file.
  5373. -// +build darwin dragonfly freebsd linux netbsd openbsd
  5374. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd
  5375. package poll
  5376. diff --git b/libgo/go/internal/syscall/unix/getentropy_hyperbolabsd.go b/libgo/go/internal/syscall/unix/getentropy_hyperbolabsd.go
  5377. new file mode 100644
  5378. index 0000000..d6cb275
  5379. --- /dev/null
  5380. +++ b/libgo/go/internal/syscall/unix/getentropy_hyperbolabsd.go
  5381. @@ -0,0 +1,29 @@
  5382. +// Copyright 2016 The Go Authors. All rights reserved.
  5383. +//
  5384. +// Modifications to support HyperbolaBSD:
  5385. +// Copyright (C) 2020-2024 Hyperbola Project
  5386. +//
  5387. +// Use of this source code is governed by a BSD-style
  5388. +// license that can be found in the LICENSE file.
  5389. +
  5390. +package unix
  5391. +
  5392. +import (
  5393. + "syscall"
  5394. + "unsafe"
  5395. +)
  5396. +
  5397. +// getentropy(2)'s syscall number, from /usr/src/sys/kern/syscalls.master
  5398. +const entropyTrap uintptr = 7
  5399. +
  5400. +// GetEntropy calls the HyperbolaBSD getentropy system call.
  5401. +func GetEntropy(p []byte) error {
  5402. + _, _, errno := syscall.Syscall(entropyTrap,
  5403. + uintptr(unsafe.Pointer(&p[0])),
  5404. + uintptr(len(p)),
  5405. + 0)
  5406. + if errno != 0 {
  5407. + return errno
  5408. + }
  5409. + return nil
  5410. +}
  5411. diff --git b/libgo/go/mime/type_hyperbolabsd.go b/libgo/go/mime/type_hyperbolabsd.go
  5412. new file mode 100644
  5413. index 0000000..ee5fc43
  5414. --- /dev/null
  5415. +++ b/libgo/go/mime/type_hyperbolabsd.go
  5416. @@ -0,0 +1,13 @@
  5417. +// Copyright 2015 The Go Authors. All rights reserved.
  5418. +//
  5419. +// Modifications to support HyperbolaBSD:
  5420. +// Copyright (C) 2020-2024 Hyperbola Project
  5421. +//
  5422. +// Use of this source code is governed by a BSD-style
  5423. +// license that can be found in the LICENSE file.
  5424. +
  5425. +package mime
  5426. +
  5427. +func init() {
  5428. + typeFiles = append(typeFiles, "/usr/share/misc/mime.types")
  5429. +}
  5430. diff --git a/libgo/go/mime/type_unix.go b/libgo/go/mime/type_unix.go
  5431. index 8e177ca..93a9d59 100644
  5432. --- a/libgo/go/mime/type_unix.go
  5433. +++ b/libgo/go/mime/type_unix.go
  5434. @@ -1,8 +1,12 @@
  5435. // Copyright 2010 The Go Authors. All rights reserved.
  5436. +//
  5437. +// Modifications to support HyperbolaBSD:
  5438. +// Copyright (C) 2020-2024 Hyperbola Project
  5439. +//
  5440. // Use of this source code is governed by a BSD-style
  5441. // license that can be found in the LICENSE file.
  5442. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  5443. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  5444. package mime
  5445. diff --git a/libgo/go/net/addrselect.go b/libgo/go/net/addrselect.go
  5446. index 7c0dfe2..dab82d8 100644
  5447. --- a/libgo/go/net/addrselect.go
  5448. +++ b/libgo/go/net/addrselect.go
  5449. @@ -1,8 +1,12 @@
  5450. // Copyright 2015 The Go Authors. All rights reserved.
  5451. +//
  5452. +// Modifications to support HyperbolaBSD:
  5453. +// Copyright (C) 2020-2024 Hyperbola Project
  5454. +//
  5455. // Use of this source code is governed by a BSD-style
  5456. // license that can be found in the LICENSE file.
  5457. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5458. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5459. // Minimal RFC 6724 address selection.
  5460. diff --git a/libgo/go/net/addrselect_test.go b/libgo/go/net/addrselect_test.go
  5461. index d6e0e63..00dda3b 100644
  5462. --- a/libgo/go/net/addrselect_test.go
  5463. +++ b/libgo/go/net/addrselect_test.go
  5464. @@ -1,8 +1,12 @@
  5465. // Copyright 2015 The Go Authors. All rights reserved.
  5466. +//
  5467. +// Modifications to support HyperbolaBSD:
  5468. +// Copyright (C) 2020-2024 Hyperbola Project
  5469. +//
  5470. // Use of this source code is governed by a BSD-style
  5471. // license that can be found in the LICENSE file.
  5472. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  5473. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5474. package net
  5475. diff --git b/libgo/go/net/cgo_hyperbolabsd.go b/libgo/go/net/cgo_hyperbolabsd.go
  5476. new file mode 100644
  5477. index 0000000..dc37c72
  5478. --- /dev/null
  5479. +++ b/libgo/go/net/cgo_hyperbolabsd.go
  5480. @@ -0,0 +1,18 @@
  5481. +// Copyright 2011 The Go Authors. All rights reserved.
  5482. +//
  5483. +// Modifications to support HyperbolaBSD:
  5484. +// Copyright (C) 2020-2024 Hyperbola Project
  5485. +//
  5486. +// Use of this source code is governed by a BSD-style
  5487. +// license that can be found in the LICENSE file.
  5488. +
  5489. +// +build cgo,!netgo
  5490. +
  5491. +package net
  5492. +
  5493. +/*
  5494. +#include <netdb.h>
  5495. +*/
  5496. +import "C"
  5497. +
  5498. +const cgoAddrInfoFlags = C.AI_CANONNAME
  5499. diff --git a/libgo/go/net/cgo_resold.go b/libgo/go/net/cgo_resold.go
  5500. index 8e13e41..142ce84 100644
  5501. --- a/libgo/go/net/cgo_resold.go
  5502. +++ b/libgo/go/net/cgo_resold.go
  5503. @@ -1,9 +1,13 @@
  5504. // Copyright 2015 The Go Authors. All rights reserved.
  5505. +//
  5506. +// Modifications to support HyperbolaBSD:
  5507. +// Copyright (C) 2020-2024 Hyperbola Project
  5508. +//
  5509. // Use of this source code is governed by a BSD-style
  5510. // license that can be found in the LICENSE file.
  5511. // +build cgo,!netgo
  5512. -// +build android freebsd dragonfly openbsd
  5513. +// +build android freebsd dragonfly openbsd hyperbolabsd
  5514. package net
  5515. diff --git a/libgo/go/net/cgo_sockold.go b/libgo/go/net/cgo_sockold.go
  5516. index 25d4f67..01e616f 100644
  5517. --- a/libgo/go/net/cgo_sockold.go
  5518. +++ b/libgo/go/net/cgo_sockold.go
  5519. @@ -1,9 +1,13 @@
  5520. // Copyright 2015 The Go Authors. All rights reserved.
  5521. +//
  5522. +// Modifications to support HyperbolaBSD:
  5523. +// Copyright (C) 2020-2024 Hyperbola Project
  5524. +//
  5525. // Use of this source code is governed by a BSD-style
  5526. // license that can be found in the LICENSE file.
  5527. // +build cgo,!netgo
  5528. -// +build aix darwin dragonfly freebsd netbsd openbsd
  5529. +// +build aix darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  5530. package net
  5531. diff --git a/libgo/go/net/cgo_unix.go b/libgo/go/net/cgo_unix.go
  5532. index 5ea13bc..d057073 100644
  5533. --- a/libgo/go/net/cgo_unix.go
  5534. +++ b/libgo/go/net/cgo_unix.go
  5535. @@ -1,9 +1,13 @@
  5536. // Copyright 2011 The Go Authors. All rights reserved.
  5537. +//
  5538. +// Modifications to support HyperbolaBSD:
  5539. +// Copyright (C) 2020-2024 Hyperbola Project
  5540. +//
  5541. // Use of this source code is governed by a BSD-style
  5542. // license that can be found in the LICENSE file.
  5543. // +build cgo,!netgo
  5544. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5545. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5546. package net
  5547. diff --git a/libgo/go/net/cgo_unix_test.go b/libgo/go/net/cgo_unix_test.go
  5548. index 49da993..aaf7297 100644
  5549. --- a/libgo/go/net/cgo_unix_test.go
  5550. +++ b/libgo/go/net/cgo_unix_test.go
  5551. @@ -1,9 +1,13 @@
  5552. // Copyright 2013 The Go Authors. All rights reserved.
  5553. +//
  5554. +// Modifications to support HyperbolaBSD:
  5555. +// Copyright (C) 2020-2024 Hyperbola Project
  5556. +//
  5557. // Use of this source code is governed by a BSD-style
  5558. // license that can be found in the LICENSE file.
  5559. // +build cgo,!netgo
  5560. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5561. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5562. package net
  5563. diff --git a/libgo/go/net/conf.go b/libgo/go/net/conf.go
  5564. index a798699..230ccd7 100644
  5565. --- a/libgo/go/net/conf.go
  5566. +++ b/libgo/go/net/conf.go
  5567. @@ -1,8 +1,12 @@
  5568. // Copyright 2015 The Go Authors. All rights reserved.
  5569. +//
  5570. +// Modifications to support HyperbolaBSD:
  5571. +// Copyright (C) 2020-2024 Hyperbola Project
  5572. +//
  5573. // Use of this source code is governed by a BSD-style
  5574. // license that can be found in the LICENSE file.
  5575. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5576. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5577. package net
  5578. @@ -85,14 +89,18 @@ func initConfVal() {
  5579. return
  5580. }
  5581. - // OpenBSD apparently lets you override the location of resolv.conf
  5582. - // with ASR_CONFIG. If we notice that, defer to libc.
  5583. + // OpenBSD (and HyperbolaBSD) apparently lets you override the
  5584. + // location of resolv.conf with ASR_CONFIG.
  5585. + // If we notice that, defer to libc.
  5586. if runtime.GOOS == "openbsd" && os.Getenv("ASR_CONFIG") != "" {
  5587. confVal.forceCgoLookupHost = true
  5588. return
  5589. + } else if runtime.GOOS == "hyperbolabsd" && os.Getenv("ASR_CONFIG") != "" {
  5590. + confVal.forceCgoLookupHost = true
  5591. + return
  5592. }
  5593. - if runtime.GOOS != "openbsd" {
  5594. + if (runtime.GOOS != "openbsd" && runtime.GOOS != "hyperbolabsd") {
  5595. confVal.nss = parseNSSConfFile("/etc/nsswitch.conf")
  5596. }
  5597. @@ -137,10 +145,10 @@ func (c *conf) hostLookupOrder(hostname string) (ret hostLookupOrder) {
  5598. return fallbackOrder
  5599. }
  5600. - // OpenBSD is unique and doesn't use nsswitch.conf.
  5601. + // OpenBSD (and HyperbolaBSD) is unique and doesn't use nsswitch.conf.
  5602. // It also doesn't support mDNS.
  5603. - if c.goos == "openbsd" {
  5604. - // OpenBSD's resolv.conf manpage says that a non-existent
  5605. + if (c.goos == "openbsd" || c.goos == "hyperbolabsd") {
  5606. + // HyperbolaBSD and OpenBSD's resolv.conf manpage says that a non-existent
  5607. // resolv.conf means "lookup" defaults to only "files",
  5608. // without DNS lookups.
  5609. if os.IsNotExist(c.resolv.err) {
  5610. diff --git a/libgo/go/net/conf_test.go b/libgo/go/net/conf_test.go
  5611. index 17d03f4..b89f5c7 100644
  5612. --- a/libgo/go/net/conf_test.go
  5613. +++ b/libgo/go/net/conf_test.go
  5614. @@ -1,8 +1,12 @@
  5615. // Copyright 2015 The Go Authors. All rights reserved.
  5616. +//
  5617. +// Modifications to support HyperbolaBSD:
  5618. +// Copyright (C) 2020-2024 Hyperbola Project
  5619. +//
  5620. // Use of this source code is governed by a BSD-style
  5621. // license that can be found in the LICENSE file.
  5622. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  5623. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5624. package net
  5625. @@ -101,6 +105,15 @@ func TestConfHostLookupOrder(t *testing.T) {
  5626. },
  5627. hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFiles}},
  5628. },
  5629. + // On HyperbolaBSD, no resolv.conf means no DNS.
  5630. + {
  5631. + name: "hyperbolabsd_no_resolv_conf",
  5632. + c: &conf{
  5633. + goos: "hyperbolabsd",
  5634. + resolv: defaultResolvConf,
  5635. + },
  5636. + hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFiles}},
  5637. + },
  5638. {
  5639. name: "solaris_no_nsswitch",
  5640. c: &conf{
  5641. @@ -110,6 +123,7 @@ func TestConfHostLookupOrder(t *testing.T) {
  5642. },
  5643. hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupCgo}},
  5644. },
  5645. + // OpenBSD lookup
  5646. {
  5647. name: "openbsd_lookup_bind_file",
  5648. c: &conf{
  5649. @@ -169,6 +183,66 @@ func TestConfHostLookupOrder(t *testing.T) {
  5650. },
  5651. hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupDNSFiles}},
  5652. },
  5653. + // HyperbolaBSD lookup
  5654. + {
  5655. + name: "hyperbolabsd_lookup_bind_file",
  5656. + c: &conf{
  5657. + goos: "hypeerbolabsd",
  5658. + resolv: &dnsConfig{lookup: []string{"bind", "file"}},
  5659. + },
  5660. + hostTests: []nssHostTest{
  5661. + {"google.com", "myhostname", hostLookupDNSFiles},
  5662. + {"foo.local", "myhostname", hostLookupDNSFiles},
  5663. + },
  5664. + },
  5665. + {
  5666. + name: "hyperbolabsd_lookup_file_bind",
  5667. + c: &conf{
  5668. + goos: "hyperbolabsd",
  5669. + resolv: &dnsConfig{lookup: []string{"file", "bind"}},
  5670. + },
  5671. + hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFilesDNS}},
  5672. + },
  5673. + {
  5674. + name: "hyperbolabsd_lookup_bind",
  5675. + c: &conf{
  5676. + goos: "hyperbolabsd",
  5677. + resolv: &dnsConfig{lookup: []string{"bind"}},
  5678. + },
  5679. + hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupDNS}},
  5680. + },
  5681. + {
  5682. + name: "hyperbolabsd_lookup_file",
  5683. + c: &conf{
  5684. + goos: "hyperbolabsd",
  5685. + resolv: &dnsConfig{lookup: []string{"file"}},
  5686. + },
  5687. + hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFiles}},
  5688. + },
  5689. + {
  5690. + name: "hyperbolabsd_lookup_yp",
  5691. + c: &conf{
  5692. + goos: "hyperbolabsd",
  5693. + resolv: &dnsConfig{lookup: []string{"file", "bind", "yp"}},
  5694. + },
  5695. + hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupCgo}},
  5696. + },
  5697. + {
  5698. + name: "hyperbolabsd_lookup_two",
  5699. + c: &conf{
  5700. + goos: "hyperbolabsd",
  5701. + resolv: &dnsConfig{lookup: []string{"file", "foo"}},
  5702. + },
  5703. + hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupCgo}},
  5704. + },
  5705. + {
  5706. + name: "hyperbolabsd_lookup_empty",
  5707. + c: &conf{
  5708. + goos: "hyperbolabsd",
  5709. + resolv: &dnsConfig{lookup: nil},
  5710. + },
  5711. + hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupDNSFiles}},
  5712. + },
  5713. // glibc lacking an nsswitch.conf, per
  5714. // http://www.gnu.org/software/libc/manual/html_node/Notes-on-NSS-Configuration-File.html
  5715. {
  5716. diff --git a/libgo/go/net/dial_test.go b/libgo/go/net/dial_test.go
  5717. index b5f1dc9..a42e7c6 100644
  5718. --- a/libgo/go/net/dial_test.go
  5719. +++ b/libgo/go/net/dial_test.go
  5720. @@ -1,4 +1,8 @@
  5721. // Copyright 2011 The Go Authors. All rights reserved.
  5722. +//
  5723. +// Modifications to support HyperbolaBSD:
  5724. +// Copyright (C) 2020-2024 Hyperbola Project
  5725. +//
  5726. // Use of this source code is governed by a BSD-style
  5727. // license that can be found in the LICENSE file.
  5728. @@ -81,6 +85,8 @@ func TestDialerDualStackFDLeak(t *testing.T) {
  5729. t.Skipf("not implemented a way to cancel dial racers in TCP SYN-SENT state on %s", runtime.GOOS)
  5730. case "openbsd":
  5731. testenv.SkipFlaky(t, 15157)
  5732. + case "hyperbolabsd":
  5733. + testenv.SkipFlaky(t, 15157)
  5734. }
  5735. if !supportsIPv4() || !supportsIPv6() {
  5736. t.Skip("both IPv4 and IPv6 are required")
  5737. @@ -169,9 +175,9 @@ func dialClosedPort() (actual, expected time.Duration) {
  5738. }
  5739. addr := l.Addr().String()
  5740. l.Close()
  5741. - // On OpenBSD, interference from TestSelfConnect is mysteriously
  5742. - // causing the first attempt to hang for a few seconds, so we throw
  5743. - // away the first result and keep the second.
  5744. + // On OpenBSD (and HyperbolaBSD), interference from TestSelfConnect
  5745. + // is mysteriously causing the first attempt to hang for a few
  5746. + // seconds, so we throw away the first result and keep the second.
  5747. for i := 1; ; i++ {
  5748. startTime := time.Now()
  5749. c, err := Dial("tcp", addr)
  5750. diff --git a/libgo/go/net/dial_unix_test.go b/libgo/go/net/dial_unix_test.go
  5751. index d5c6dde..39806a6 100644
  5752. --- a/libgo/go/net/dial_unix_test.go
  5753. +++ b/libgo/go/net/dial_unix_test.go
  5754. @@ -1,8 +1,12 @@
  5755. // Copyright 2016 The Go Authors. All rights reserved.
  5756. +//
  5757. +// Modifications to support HyperbolaBSD:
  5758. +// Copyright (C) 2020-2024 Hyperbola Project
  5759. +//
  5760. // Use of this source code is governed by a BSD-style
  5761. // license that can be found in the LICENSE file.
  5762. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5763. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5764. package net
  5765. diff --git a/libgo/go/net/dnsclient_unix.go b/libgo/go/net/dnsclient_unix.go
  5766. index 73a507e..a4d3ff4 100644
  5767. --- a/libgo/go/net/dnsclient_unix.go
  5768. +++ b/libgo/go/net/dnsclient_unix.go
  5769. @@ -1,8 +1,12 @@
  5770. // Copyright 2009 The Go Authors. All rights reserved.
  5771. +//
  5772. +// Modifications to support HyperbolaBSD:
  5773. +// Copyright (C) 2020-2024 Hyperbola Project
  5774. +//
  5775. // Use of this source code is governed by a BSD-style
  5776. // license that can be found in the LICENSE file.
  5777. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5778. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5779. // DNS client: see RFC 1035.
  5780. // Has to be linked into package net for Dial.
  5781. diff --git a/libgo/go/net/dnsclient_unix_test.go b/libgo/go/net/dnsclient_unix_test.go
  5782. index 9e4015f..9218d1e 100644
  5783. --- a/libgo/go/net/dnsclient_unix_test.go
  5784. +++ b/libgo/go/net/dnsclient_unix_test.go
  5785. @@ -1,8 +1,12 @@
  5786. // Copyright 2013 The Go Authors. All rights reserved.
  5787. +//
  5788. +// Modifications to support HyperbolaBSD:
  5789. +// Copyright (C) 2020-2024 Hyperbola Project
  5790. +//
  5791. // Use of this source code is governed by a BSD-style
  5792. // license that can be found in the LICENSE file.
  5793. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5794. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5795. package net
  5796. diff --git a/libgo/go/net/dnsconfig_unix.go b/libgo/go/net/dnsconfig_unix.go
  5797. index 24487af..ea4f84f 100644
  5798. --- a/libgo/go/net/dnsconfig_unix.go
  5799. +++ b/libgo/go/net/dnsconfig_unix.go
  5800. @@ -1,8 +1,12 @@
  5801. // Copyright 2009 The Go Authors. All rights reserved.
  5802. +//
  5803. +// Modifications to support HyperbolaBSD:
  5804. +// Copyright (C) 2020-2024 Hyperbola Project
  5805. +//
  5806. // Use of this source code is governed by a BSD-style
  5807. // license that can be found in the LICENSE file.
  5808. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5809. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5810. // Read system DNS config from /etc/resolv.conf
  5811. @@ -27,7 +31,7 @@ type dnsConfig struct {
  5812. attempts int // lost packets before giving up on server
  5813. rotate bool // round robin among servers
  5814. unknownOpt bool // anything unknown was encountered
  5815. - lookup []string // OpenBSD top-level database "lookup" order
  5816. + lookup []string // OpenBSD (and HyperbolaBSD) top-level database "lookup" order
  5817. err error // any error that occurs during open of resolv.conf
  5818. mtime time.Time // time of resolv.conf modification
  5819. soffset uint32 // used by serverOffset
  5820. @@ -120,7 +124,7 @@ func dnsReadConfig(filename string) *dnsConfig {
  5821. }
  5822. case "lookup":
  5823. - // OpenBSD option:
  5824. + // OpenBSD (and HyperbolaBSD) option:
  5825. // http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/resolv.conf.5
  5826. // "the legal space-separated values are: bind, file, yp"
  5827. conf.lookup = f[1:]
  5828. diff --git a/libgo/go/net/dnsconfig_unix_test.go b/libgo/go/net/dnsconfig_unix_test.go
  5829. index 0797559..aa7daac 100644
  5830. --- a/libgo/go/net/dnsconfig_unix_test.go
  5831. +++ b/libgo/go/net/dnsconfig_unix_test.go
  5832. @@ -1,8 +1,12 @@
  5833. // Copyright 2013 The Go Authors. All rights reserved.
  5834. +//
  5835. +// Modifications to support HyperbolaBSD:
  5836. +// Copyright (C) 2020-2024 Hyperbola Project
  5837. +//
  5838. // Use of this source code is governed by a BSD-style
  5839. // license that can be found in the LICENSE file.
  5840. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5841. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5842. package net
  5843. @@ -102,6 +106,17 @@ var dnsReadConfigTests = []struct {
  5844. search: []string{"c.symbolic-datum-552.internal."},
  5845. },
  5846. },
  5847. + {
  5848. + name: "testdata/hyperbolabsd-resolv.conf",
  5849. + want: &dnsConfig{
  5850. + ndots: 1,
  5851. + timeout: 5 * time.Second,
  5852. + attempts: 2,
  5853. + lookup: []string{"file", "bind"},
  5854. + servers: []string{"169.254.169.254:53", "10.240.0.1:53"},
  5855. + search: []string{"c.symbolic-datum-552.internal."},
  5856. + },
  5857. + },
  5858. }
  5859. func TestDNSReadConfig(t *testing.T) {
  5860. diff --git a/libgo/go/net/error_posix.go b/libgo/go/net/error_posix.go
  5861. index d0ffaae..84e087f 100644
  5862. --- a/libgo/go/net/error_posix.go
  5863. +++ b/libgo/go/net/error_posix.go
  5864. @@ -1,8 +1,12 @@
  5865. // Copyright 2017 The Go Authors. All rights reserved.
  5866. +//
  5867. +// Modifications to support HyperbolaBSD:
  5868. +// Copyright (C) 2020-2024 Hyperbola Project
  5869. +//
  5870. // Use of this source code is governed by a BSD-style
  5871. // license that can be found in the LICENSE file.
  5872. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  5873. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  5874. package net
  5875. diff --git a/libgo/go/net/fd_unix.go b/libgo/go/net/fd_unix.go
  5876. index 95d5e4f..57f511d 100644
  5877. --- a/libgo/go/net/fd_unix.go
  5878. +++ b/libgo/go/net/fd_unix.go
  5879. @@ -1,8 +1,12 @@
  5880. // Copyright 2009 The Go Authors. All rights reserved.
  5881. +//
  5882. +// Modifications to support HyperbolaBSD:
  5883. +// Copyright (C) 2020-2024 Hyperbola Project
  5884. +//
  5885. // Use of this source code is governed by a BSD-style
  5886. // license that can be found in the LICENSE file.
  5887. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  5888. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  5889. package net
  5890. diff --git a/libgo/go/net/file_unix.go b/libgo/go/net/file_unix.go
  5891. index 3655a89..8f94677 100644
  5892. --- a/libgo/go/net/file_unix.go
  5893. +++ b/libgo/go/net/file_unix.go
  5894. @@ -1,8 +1,12 @@
  5895. // Copyright 2011 The Go Authors. All rights reserved.
  5896. +//
  5897. +// Modifications to support HyperbolaBSD:
  5898. +// Copyright (C) 2020-2024 Hyperbola Project
  5899. +//
  5900. // Use of this source code is governed by a BSD-style
  5901. // license that can be found in the LICENSE file.
  5902. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5903. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  5904. package net
  5905. diff --git a/libgo/go/net/hook_unix.go b/libgo/go/net/hook_unix.go
  5906. index 7d58d0f..e5a9f14 100644
  5907. --- a/libgo/go/net/hook_unix.go
  5908. +++ b/libgo/go/net/hook_unix.go
  5909. @@ -1,8 +1,12 @@
  5910. // Copyright 2015 The Go Authors. All rights reserved.
  5911. +//
  5912. +// Modifications to support HyperbolaBSD:
  5913. +// Copyright (C) 2020-2024 Hyperbola Project
  5914. +//
  5915. // Use of this source code is governed by a BSD-style
  5916. // license that can be found in the LICENSE file.
  5917. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  5918. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  5919. package net
  5920. diff --git a/libgo/go/net/http/cgi/host.go b/libgo/go/net/http/cgi/host.go
  5921. index 58e9f71..9f9a8a8 100644
  5922. --- a/libgo/go/net/http/cgi/host.go
  5923. +++ b/libgo/go/net/http/cgi/host.go
  5924. @@ -1,4 +1,8 @@
  5925. // Copyright 2011 The Go Authors. All rights reserved.
  5926. +//
  5927. +// Modifications to support HyperbolaBSD:
  5928. +// Copyright (C) 2020-2024 Hyperbola Project
  5929. +//
  5930. // Use of this source code is governed by a BSD-style
  5931. // license that can be found in the LICENSE file.
  5932. @@ -39,6 +43,7 @@ var osDefaultInheritEnv = map[string][]string{
  5933. "irix": {"LD_LIBRARY_PATH", "LD_LIBRARYN32_PATH", "LD_LIBRARY64_PATH"},
  5934. "linux": {"LD_LIBRARY_PATH"},
  5935. "openbsd": {"LD_LIBRARY_PATH"},
  5936. + "hyperbolabsd": {"LD_LIBRARY_PATH"},
  5937. "solaris": {"LD_LIBRARY_PATH", "LD_LIBRARY_PATH_32", "LD_LIBRARY_PATH_64"},
  5938. "windows": {"SystemRoot", "COMSPEC", "PATHEXT", "WINDIR"},
  5939. }
  5940. diff --git a/libgo/go/net/interface.go b/libgo/go/net/interface.go
  5941. index 4036a7f..6a7d6dc 100644
  5942. --- a/libgo/go/net/interface.go
  5943. +++ b/libgo/go/net/interface.go
  5944. @@ -1,4 +1,8 @@
  5945. // Copyright 2011 The Go Authors. All rights reserved.
  5946. +//
  5947. +// Modifications to support HyperbolaBSD:
  5948. +// Copyright (C) 2024 Hyperbola Project
  5949. +//
  5950. // Use of this source code is governed by a BSD-style
  5951. // license that can be found in the LICENSE file.
  5952. @@ -13,7 +17,7 @@ import (
  5953. // BUG(mikio): On NaCl, methods and functions related to
  5954. // Interface are not implemented.
  5955. -// BUG(mikio): On DragonFly BSD, NetBSD, OpenBSD, Plan 9 and Solaris,
  5956. +// BUG(mikio): On DragonFly BSD, NetBSD, OpenBSD, HyperbolaBSD, Plan 9 and Solaris,
  5957. // the MulticastAddrs method of Interface is not implemented.
  5958. var (
  5959. diff --git a/libgo/go/net/interface_bsd.go b/libgo/go/net/interface_bsd.go
  5960. index 35b1c26..563cf77 100644
  5961. --- a/libgo/go/net/interface_bsd.go
  5962. +++ b/libgo/go/net/interface_bsd.go
  5963. @@ -1,8 +1,12 @@
  5964. // Copyright 2011 The Go Authors. All rights reserved.
  5965. +//
  5966. +// Modifications to support HyperbolaBSD:
  5967. +// Copyright (C) 2020-2024 Hyperbola Project
  5968. +//
  5969. // Use of this source code is governed by a BSD-style
  5970. // license that can be found in the LICENSE file.
  5971. -// +build darwin dragonfly freebsd netbsd openbsd
  5972. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  5973. package net
  5974. diff --git a/libgo/go/net/interface_bsdvar.go b/libgo/go/net/interface_bsdvar.go
  5975. index 0b84ca3..c161ad9 100644
  5976. --- a/libgo/go/net/interface_bsdvar.go
  5977. +++ b/libgo/go/net/interface_bsdvar.go
  5978. @@ -1,8 +1,12 @@
  5979. // Copyright 2011 The Go Authors. All rights reserved.
  5980. +//
  5981. +// Modifications to support HyperbolaBSD:
  5982. +// Copyright (C) 2020-2024 Hyperbola Project
  5983. +//
  5984. // Use of this source code is governed by a BSD-style
  5985. // license that can be found in the LICENSE file.
  5986. -// +build dragonfly netbsd openbsd
  5987. +// +build dragonfly netbsd openbsd hyperbolabsd
  5988. package net
  5989. diff --git a/libgo/go/net/interface_test.go b/libgo/go/net/interface_test.go
  5990. index 534137a..32df538 100644
  5991. --- a/libgo/go/net/interface_test.go
  5992. +++ b/libgo/go/net/interface_test.go
  5993. @@ -1,4 +1,8 @@
  5994. // Copyright 2011 The Go Authors. All rights reserved.
  5995. +//
  5996. +// Modifications to support HyperbolaBSD:
  5997. +// Copyright (C) 2020-2024 Hyperbola Project
  5998. +//
  5999. // Use of this source code is governed by a BSD-style
  6000. // license that can be found in the LICENSE file.
  6001. @@ -276,7 +280,7 @@ func checkUnicastStats(ifStats *ifStats, uniStats *routeStats) error {
  6002. func checkMulticastStats(ifStats *ifStats, uniStats, multiStats *routeStats) error {
  6003. switch runtime.GOOS {
  6004. - case "dragonfly", "nacl", "netbsd", "openbsd", "plan9", "solaris":
  6005. + case "dragonfly", "nacl", "netbsd", "openbsd", "hyperbolabsd", "plan9", "solaris":
  6006. default:
  6007. // Test the existence of connected multicast route
  6008. // clones for IPv4. Unlike IPv6, IPv4 multicast
  6009. diff --git a/libgo/go/net/internal/socktest/switch_unix.go b/libgo/go/net/internal/socktest/switch_unix.go
  6010. index 8fb15f3..b68e6bc 100644
  6011. --- a/libgo/go/net/internal/socktest/switch_unix.go
  6012. +++ b/libgo/go/net/internal/socktest/switch_unix.go
  6013. @@ -1,8 +1,12 @@
  6014. // Copyright 2015 The Go Authors. All rights reserved.
  6015. +//
  6016. +// Modifications to support HyperbolaBSD:
  6017. +// Copyright (C) 2020-2024 Hyperbola Project
  6018. +//
  6019. // Use of this source code is governed by a BSD-style
  6020. // license that can be found in the LICENSE file.
  6021. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6022. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6023. package socktest
  6024. diff --git a/libgo/go/net/internal/socktest/sys_unix.go b/libgo/go/net/internal/socktest/sys_unix.go
  6025. index 397c524..caf08f6 100644
  6026. --- a/libgo/go/net/internal/socktest/sys_unix.go
  6027. +++ b/libgo/go/net/internal/socktest/sys_unix.go
  6028. @@ -1,8 +1,12 @@
  6029. // Copyright 2015 The Go Authors. All rights reserved.
  6030. +//
  6031. +// Modifications to support HyperbolaBSD:
  6032. +// Copyright (C) 2020-2024 Hyperbola Project
  6033. +//
  6034. // Use of this source code is governed by a BSD-style
  6035. // license that can be found in the LICENSE file.
  6036. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6037. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6038. package socktest
  6039. diff --git a/libgo/go/net/iprawsock_posix.go b/libgo/go/net/iprawsock_posix.go
  6040. index d613e6f..946910f 100644
  6041. --- a/libgo/go/net/iprawsock_posix.go
  6042. +++ b/libgo/go/net/iprawsock_posix.go
  6043. @@ -1,8 +1,12 @@
  6044. // Copyright 2010 The Go Authors. All rights reserved.
  6045. +//
  6046. +// Modifications to support HyperbolaBSD:
  6047. +// Copyright (C) 2020-2024 Hyperbola Project
  6048. +//
  6049. // Use of this source code is governed by a BSD-style
  6050. // license that can be found in the LICENSE file.
  6051. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6052. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6053. package net
  6054. diff --git a/libgo/go/net/ipsock.go b/libgo/go/net/ipsock.go
  6055. index 947bdf3..cf8956b 100644
  6056. --- a/libgo/go/net/ipsock.go
  6057. +++ b/libgo/go/net/ipsock.go
  6058. @@ -1,4 +1,8 @@
  6059. // Copyright 2009 The Go Authors. All rights reserved.
  6060. +//
  6061. +// Modifications to support HyperbolaBSD:
  6062. +// Copyright (C) 2024 Hyperbola Project
  6063. +//
  6064. // Use of this source code is governed by a BSD-style
  6065. // license that can be found in the LICENSE file.
  6066. @@ -9,11 +13,11 @@ import (
  6067. "sync"
  6068. )
  6069. -// BUG(rsc,mikio): On DragonFly BSD and OpenBSD, listening on the
  6070. -// "tcp" and "udp" networks does not listen for both IPv4 and IPv6
  6071. -// connections. This is due to the fact that IPv4 traffic will not be
  6072. -// routed to an IPv6 socket - two separate sockets are required if
  6073. -// both address families are to be supported.
  6074. +// BUG(rsc,mikio): On DragonFly BSD, HyperbolaBSD and OpenBSD,
  6075. +// listening on the "tcp" and "udp" networks does not listen for both
  6076. +// IPv4 and IPv6 connections. This is due to the fact that
  6077. +// IPv4 traffic will not be routed to an IPv6 socket - two separate
  6078. +// sockets are required if both address families are to be supported.
  6079. // See inet6(4) for details.
  6080. type ipStackCapabilities struct {
  6081. diff --git a/libgo/go/net/ipsock_posix.go b/libgo/go/net/ipsock_posix.go
  6082. index 9cff960..17cf6c3 100644
  6083. --- a/libgo/go/net/ipsock_posix.go
  6084. +++ b/libgo/go/net/ipsock_posix.go
  6085. @@ -1,8 +1,12 @@
  6086. // Copyright 2009 The Go Authors. All rights reserved.
  6087. +//
  6088. +// Modifications to support HyperbolaBSD:
  6089. +// Copyright (C) 2020-2024 Hyperbola Project
  6090. +//
  6091. // Use of this source code is governed by a BSD-style
  6092. // license that can be found in the LICENSE file.
  6093. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6094. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6095. package net
  6096. @@ -41,8 +45,8 @@ func (p *ipStackCapabilities) probe() {
  6097. {laddr: TCPAddr{IP: IPv4(127, 0, 0, 1)}, value: 0},
  6098. }
  6099. switch runtime.GOOS {
  6100. - case "dragonfly", "openbsd":
  6101. - // The latest DragonFly BSD and OpenBSD kernels don't
  6102. + case "dragonfly", "openbsd", "hyperbolabsd":
  6103. + // The latest DragonFly BSD, HyperbolaBSD and OpenBSD kernels don't
  6104. // support IPV6_V6ONLY=0. They always return an error
  6105. // and we don't need to probe the capability.
  6106. probes = probes[:1]
  6107. @@ -105,7 +109,7 @@ func (p *ipStackCapabilities) probe() {
  6108. // or else returns AF_INET6. It also returns a boolean value what
  6109. // designates IPV6_V6ONLY option.
  6110. //
  6111. -// Note that the latest DragonFly BSD and OpenBSD kernels allow
  6112. +// Note that the latest DragonFly BSD, HyperbolaBSD and OpenBSD kernels allow
  6113. // neither "net.inet6.ip6.v6only=1" change nor IPPROTO_IPV6 level
  6114. // IPV6_V6ONLY socket option setting.
  6115. func favoriteAddrFamily(network string, laddr, raddr sockaddr, mode string) (family int, ipv6only bool) {
  6116. @@ -134,7 +138,7 @@ func favoriteAddrFamily(network string, laddr, raddr sockaddr, mode string) (fam
  6117. }
  6118. func internetSocket(ctx context.Context, net string, laddr, raddr sockaddr, sotype, proto int, mode string) (fd *netFD, err error) {
  6119. - if (runtime.GOOS == "windows" || runtime.GOOS == "openbsd" || runtime.GOOS == "nacl") && mode == "dial" && raddr.isWildcard() {
  6120. + if (runtime.GOOS == "windows" || runtime.GOOS == "openbsd" || runtime.GOOS == "hyperbolabsd" || runtime.GOOS == "nacl") && mode == "dial" && raddr.isWildcard() {
  6121. raddr = raddr.toLocal(net)
  6122. }
  6123. family, ipv6only := favoriteAddrFamily(net, laddr, raddr, mode)
  6124. diff --git a/libgo/go/net/listen_test.go b/libgo/go/net/listen_test.go
  6125. index 96624f9..c58e8bf 100644
  6126. --- a/libgo/go/net/listen_test.go
  6127. +++ b/libgo/go/net/listen_test.go
  6128. @@ -1,4 +1,8 @@
  6129. // Copyright 2011 The Go Authors. All rights reserved.
  6130. +//
  6131. +// Modifications to support HyperbolaBSD:
  6132. +// Copyright (C) 2020-2024 Hyperbola Project
  6133. +//
  6134. // Use of this source code is governed by a BSD-style
  6135. // license that can be found in the LICENSE file.
  6136. @@ -192,6 +196,8 @@ var dualStackTCPListenerTests = []struct {
  6137. // net.ipv6.bindv6only=0 (overridable by sysctl or IPV6_V6ONLY option)
  6138. // openbsd, kernel version 5.0
  6139. // net.inet6.ip6.v6only=1 (overriding is prohibited)
  6140. + // hyperbolabsd (openbsd based)
  6141. + // net.inet6.ip6.v6only=1 (overriding is prohibited)
  6142. {"tcp", "", "tcp", "", syscall.EADDRINUSE},
  6143. {"tcp", "", "tcp", "0.0.0.0", syscall.EADDRINUSE},
  6144. @@ -673,7 +679,7 @@ func checkMulticastListener(c *UDPConn, ip IP) error {
  6145. func multicastRIBContains(ip IP) (bool, error) {
  6146. switch runtime.GOOS {
  6147. - case "dragonfly", "netbsd", "openbsd", "plan9", "solaris", "windows":
  6148. + case "dragonfly", "netbsd", "openbsd", "hyperbolabsd", "plan9", "solaris", "windows":
  6149. return true, nil // not implemented yet
  6150. case "linux":
  6151. if runtime.GOARCH == "arm" || runtime.GOARCH == "alpha" {
  6152. diff --git a/libgo/go/net/lookup_unix.go b/libgo/go/net/lookup_unix.go
  6153. index 2813f14..ebdcf08 100644
  6154. --- a/libgo/go/net/lookup_unix.go
  6155. +++ b/libgo/go/net/lookup_unix.go
  6156. @@ -1,8 +1,12 @@
  6157. // Copyright 2011 The Go Authors. All rights reserved.
  6158. +//
  6159. +// Modifications to support HyperbolaBSD:
  6160. +// Copyright (C) 2020-2024 Hyperbola Project
  6161. +//
  6162. // Use of this source code is governed by a BSD-style
  6163. // license that can be found in the LICENSE file.
  6164. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  6165. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6166. package net
  6167. diff --git a/libgo/go/net/main_test.go b/libgo/go/net/main_test.go
  6168. index 3e7a85a..1e8beba 100644
  6169. --- a/libgo/go/net/main_test.go
  6170. +++ b/libgo/go/net/main_test.go
  6171. @@ -1,4 +1,8 @@
  6172. // Copyright 2015 The Go Authors. All rights reserved.
  6173. +//
  6174. +// Modifications to support HyperbolaBSD:
  6175. +// Copyright (C) 2020-2024 Hyperbola Project
  6176. +//
  6177. // Use of this source code is governed by a BSD-style
  6178. // license that can be found in the LICENSE file.
  6179. @@ -131,7 +135,7 @@ func setupTestData() {
  6180. {"udp6", "[" + addr + "%" + ifi.Name + "]:0", false},
  6181. }...)
  6182. switch runtime.GOOS {
  6183. - case "darwin", "dragonfly", "freebsd", "openbsd", "netbsd":
  6184. + case "darwin", "dragonfly", "freebsd", "hyperbolabsd", "openbsd", "netbsd":
  6185. ipv6LinkLocalUnicastTCPTests = append(ipv6LinkLocalUnicastTCPTests, []ipv6LinkLocalUnicastTest{
  6186. {"tcp", "[localhost%" + ifi.Name + "]:0", true},
  6187. {"tcp6", "[localhost%" + ifi.Name + "]:0", true},
  6188. diff --git a/libgo/go/net/main_unix_test.go b/libgo/go/net/main_unix_test.go
  6189. index 34a8a10..649d0fe 100644
  6190. --- a/libgo/go/net/main_unix_test.go
  6191. +++ b/libgo/go/net/main_unix_test.go
  6192. @@ -1,8 +1,12 @@
  6193. // Copyright 2015 The Go Authors. All rights reserved.
  6194. +//
  6195. +// Modifications to support HyperbolaBSD:
  6196. +// Copyright (C) 2020-2024 Hyperbola Project
  6197. +//
  6198. // Use of this source code is governed by a BSD-style
  6199. // license that can be found in the LICENSE file.
  6200. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6201. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6202. package net
  6203. diff --git a/libgo/go/net/net.go b/libgo/go/net/net.go
  6204. index 3ad9103..b9659de 100644
  6205. --- a/libgo/go/net/net.go
  6206. +++ b/libgo/go/net/net.go
  6207. @@ -1,4 +1,8 @@
  6208. // Copyright 2009 The Go Authors. All rights reserved.
  6209. +//
  6210. +// Modifications to support HyperbolaBSD:
  6211. +// Copyright (C) 2024 Hyperbola Project
  6212. +//
  6213. // Use of this source code is governed by a BSD-style
  6214. // license that can be found in the LICENSE file.
  6215. @@ -52,7 +56,7 @@ When cgo is available, the cgo-based resolver is used instead under a variety of
  6216. conditions: on systems that do not let programs make direct DNS requests (OS X),
  6217. when the LOCALDOMAIN environment variable is present (even if empty),
  6218. when the RES_OPTIONS or HOSTALIASES environment variable is non-empty,
  6219. -when the ASR_CONFIG environment variable is non-empty (OpenBSD only),
  6220. +when the ASR_CONFIG environment variable is non-empty (OpenBSD and HyperbolaBSD only),
  6221. when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the
  6222. Go resolver does not implement, and when the name being looked up ends in .local
  6223. or is an mDNS name.
  6224. diff --git a/libgo/go/net/nss.go b/libgo/go/net/nss.go
  6225. index 1650f5e..315891b 100644
  6226. --- a/libgo/go/net/nss.go
  6227. +++ b/libgo/go/net/nss.go
  6228. @@ -1,8 +1,12 @@
  6229. // Copyright 2015 The Go Authors. All rights reserved.
  6230. +//
  6231. +// Modifications to support HyperbolaBSD:
  6232. +// Copyright (C) 2020-2024 Hyperbola Project
  6233. +//
  6234. // Use of this source code is governed by a BSD-style
  6235. // license that can be found in the LICENSE file.
  6236. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  6237. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6238. package net
  6239. diff --git a/libgo/go/net/nss_test.go b/libgo/go/net/nss_test.go
  6240. index 371deb5..ce32d75 100644
  6241. --- a/libgo/go/net/nss_test.go
  6242. +++ b/libgo/go/net/nss_test.go
  6243. @@ -1,8 +1,12 @@
  6244. // Copyright 2015 The Go Authors. All rights reserved.
  6245. +//
  6246. +// Modifications to support HyperbolaBSD:
  6247. +// Copyright (C) 2020-2024 Hyperbola Project
  6248. +//
  6249. // Use of this source code is governed by a BSD-style
  6250. // license that can be found in the LICENSE file.
  6251. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  6252. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6253. package net
  6254. diff --git a/libgo/go/net/port_unix.go b/libgo/go/net/port_unix.go
  6255. index 8dd1c32..2de66b6 100644
  6256. --- a/libgo/go/net/port_unix.go
  6257. +++ b/libgo/go/net/port_unix.go
  6258. @@ -1,8 +1,12 @@
  6259. // Copyright 2009 The Go Authors. All rights reserved.
  6260. +//
  6261. +// Modifications to support HyperbolaBSD:
  6262. +// Copyright (C) 2020-2024 Hyperbola Project
  6263. +//
  6264. // Use of this source code is governed by a BSD-style
  6265. // license that can be found in the LICENSE file.
  6266. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris nacl
  6267. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris nacl
  6268. // Read system port mappings from /etc/services
  6269. diff --git a/libgo/go/net/rawconn_unix_test.go b/libgo/go/net/rawconn_unix_test.go
  6270. index 913ad86..af8b335 100644
  6271. --- a/libgo/go/net/rawconn_unix_test.go
  6272. +++ b/libgo/go/net/rawconn_unix_test.go
  6273. @@ -1,8 +1,12 @@
  6274. // Copyright 2017 The Go Authors. All rights reserved.
  6275. +//
  6276. +// Modifications to support HyperbolaBSD:
  6277. +// Copyright (C) 2020-2024 Hyperbola Project
  6278. +//
  6279. // Use of this source code is governed by a BSD-style
  6280. // license that can be found in the LICENSE file.
  6281. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  6282. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6283. package net
  6284. diff --git a/libgo/go/net/sendfile_stub.go b/libgo/go/net/sendfile_stub.go
  6285. index f043062..de3e305 100644
  6286. --- a/libgo/go/net/sendfile_stub.go
  6287. +++ b/libgo/go/net/sendfile_stub.go
  6288. @@ -1,8 +1,12 @@
  6289. // Copyright 2011 The Go Authors. All rights reserved.
  6290. +//
  6291. +// Modifications to support HyperbolaBSD:
  6292. +// Copyright (C) 2020-2024 Hyperbola Project
  6293. +//
  6294. // Use of this source code is governed by a BSD-style
  6295. // license that can be found in the LICENSE file.
  6296. -// +build aix darwin nacl netbsd openbsd
  6297. +// +build aix darwin nacl netbsd openbsd hyperbolabsd
  6298. package net
  6299. diff --git a/libgo/go/net/sock_bsd.go b/libgo/go/net/sock_bsd.go
  6300. index 516e557..752d6f3 100644
  6301. --- a/libgo/go/net/sock_bsd.go
  6302. +++ b/libgo/go/net/sock_bsd.go
  6303. @@ -1,8 +1,12 @@
  6304. // Copyright 2009 The Go Authors. All rights reserved.
  6305. +//
  6306. +// Modifications to support HyperbolaBSD:
  6307. +// Copyright (C) 2020-2024 Hyperbola Project
  6308. +//
  6309. // Use of this source code is governed by a BSD-style
  6310. // license that can be found in the LICENSE file.
  6311. -// +build darwin dragonfly freebsd netbsd openbsd
  6312. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  6313. package net
  6314. @@ -25,6 +29,8 @@ func maxListenerBacklog() int {
  6315. // NOTE: NetBSD has no somaxconn-like kernel state so far
  6316. case "openbsd":
  6317. n, err = syscall.SysctlUint32("kern.somaxconn")
  6318. + case "hyperbolabsd":
  6319. + n, err = syscall.SysctlUint32("kern.somaxconn")
  6320. }
  6321. if n == 0 || err != nil {
  6322. return syscall.SOMAXCONN
  6323. diff --git a/libgo/go/net/sock_posix.go b/libgo/go/net/sock_posix.go
  6324. index 4733c42..8ac4274 100644
  6325. --- a/libgo/go/net/sock_posix.go
  6326. +++ b/libgo/go/net/sock_posix.go
  6327. @@ -1,8 +1,12 @@
  6328. // Copyright 2009 The Go Authors. All rights reserved.
  6329. +//
  6330. +// Modifications to support HyperbolaBSD:
  6331. +// Copyright (C) 2020-2024 Hyperbola Project
  6332. +//
  6333. // Use of this source code is governed by a BSD-style
  6334. // license that can be found in the LICENSE file.
  6335. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6336. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6337. package net
  6338. diff --git a/libgo/go/net/sockopt_bsd.go b/libgo/go/net/sockopt_bsd.go
  6339. index 1aae88a..cb43158 100644
  6340. --- a/libgo/go/net/sockopt_bsd.go
  6341. +++ b/libgo/go/net/sockopt_bsd.go
  6342. @@ -1,8 +1,12 @@
  6343. // Copyright 2011 The Go Authors. All rights reserved.
  6344. +//
  6345. +// Modifications to support HyperbolaBSD:
  6346. +// Copyright (C) 2020-2024 Hyperbola Project
  6347. +//
  6348. // Use of this source code is governed by a BSD-style
  6349. // license that can be found in the LICENSE file.
  6350. -// +build darwin dragonfly freebsd netbsd openbsd
  6351. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  6352. package net
  6353. diff --git a/libgo/go/net/sockopt_posix.go b/libgo/go/net/sockopt_posix.go
  6354. index 29edddb..c63689f 100644
  6355. --- a/libgo/go/net/sockopt_posix.go
  6356. +++ b/libgo/go/net/sockopt_posix.go
  6357. @@ -1,8 +1,12 @@
  6358. // Copyright 2009 The Go Authors. All rights reserved.
  6359. +//
  6360. +// Modifications to support HyperbolaBSD:
  6361. +// Copyright (C) 2020-2024 Hyperbola Project
  6362. +//
  6363. // Use of this source code is governed by a BSD-style
  6364. // license that can be found in the LICENSE file.
  6365. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
  6366. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris windows
  6367. package net
  6368. diff --git a/libgo/go/net/sockoptip_bsdvar.go b/libgo/go/net/sockoptip_bsdvar.go
  6369. index 9560101..637be78 100644
  6370. --- a/libgo/go/net/sockoptip_bsdvar.go
  6371. +++ b/libgo/go/net/sockoptip_bsdvar.go
  6372. @@ -1,8 +1,12 @@
  6373. // Copyright 2011 The Go Authors. All rights reserved.
  6374. +//
  6375. +// Modifications to support HyperbolaBSD:
  6376. +// Copyright (C) 2020-2024 Hyperbola Project
  6377. +//
  6378. // Use of this source code is governed by a BSD-style
  6379. // license that can be found in the LICENSE file.
  6380. -// +build darwin dragonfly freebsd netbsd openbsd solaris
  6381. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd solaris
  6382. package net
  6383. diff --git a/libgo/go/net/sockoptip_posix.go b/libgo/go/net/sockoptip_posix.go
  6384. index b14963f..9b6e1a9 100644
  6385. --- a/libgo/go/net/sockoptip_posix.go
  6386. +++ b/libgo/go/net/sockoptip_posix.go
  6387. @@ -1,8 +1,12 @@
  6388. // Copyright 2011 The Go Authors. All rights reserved.
  6389. +//
  6390. +// Modifications to support HyperbolaBSD:
  6391. +// Copyright (C) 2020-2024 Hyperbola Project
  6392. +//
  6393. // Use of this source code is governed by a BSD-style
  6394. // license that can be found in the LICENSE file.
  6395. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
  6396. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris windows
  6397. package net
  6398. diff --git a/libgo/go/net/sys_cloexec.go b/libgo/go/net/sys_cloexec.go
  6399. index def05cb..5f3fe60 100644
  6400. --- a/libgo/go/net/sys_cloexec.go
  6401. +++ b/libgo/go/net/sys_cloexec.go
  6402. @@ -1,11 +1,15 @@
  6403. // Copyright 2013 The Go Authors. All rights reserved.
  6404. +//
  6405. +// Modifications to support HyperbolaBSD:
  6406. +// Copyright (C) 2020-2024 Hyperbola Project
  6407. +//
  6408. // Use of this source code is governed by a BSD-style
  6409. // license that can be found in the LICENSE file.
  6410. // This file implements sysSocket and accept for platforms that do not
  6411. // provide a fast path for setting SetNonblock and CloseOnExec.
  6412. -// +build aix darwin nacl netbsd openbsd solaris
  6413. +// +build aix darwin nacl netbsd openbsd hyperbolabsd solaris
  6414. package net
  6415. diff --git a/libgo/go/net/tcpsock_posix.go b/libgo/go/net/tcpsock_posix.go
  6416. index 9ba199d..49f177e 100644
  6417. --- a/libgo/go/net/tcpsock_posix.go
  6418. +++ b/libgo/go/net/tcpsock_posix.go
  6419. @@ -1,8 +1,12 @@
  6420. // Copyright 2009 The Go Authors. All rights reserved.
  6421. +//
  6422. +// Modifications to support HyperbolaBSD:
  6423. +// Copyright (C) 2020-2024 Hyperbola Project
  6424. +//
  6425. // Use of this source code is governed by a BSD-style
  6426. // license that can be found in the LICENSE file.
  6427. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6428. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6429. package net
  6430. diff --git a/libgo/go/net/tcpsock_test.go b/libgo/go/net/tcpsock_test.go
  6431. index 04b38b6..5e15763 100644
  6432. --- a/libgo/go/net/tcpsock_test.go
  6433. +++ b/libgo/go/net/tcpsock_test.go
  6434. @@ -1,4 +1,8 @@
  6435. // Copyright 2012 The Go Authors. All rights reserved.
  6436. +//
  6437. +// Modifications to support HyperbolaBSD:
  6438. +// Copyright (C) 2020-2024 Hyperbola Project
  6439. +//
  6440. // Use of this source code is governed by a BSD-style
  6441. // license that can be found in the LICENSE file.
  6442. @@ -654,7 +658,7 @@ func TestTCPSelfConnect(t *testing.T) {
  6443. n = 1000
  6444. }
  6445. switch runtime.GOOS {
  6446. - case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "plan9", "solaris", "windows":
  6447. + case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "hyperbolabsd", "plan9", "solaris", "windows":
  6448. // Non-Linux systems take a long time to figure
  6449. // out that there is nothing listening on localhost.
  6450. n = 100
  6451. diff --git b/libgo/go/net/tcpsockopt_hyperbolabsd.go b/libgo/go/net/tcpsockopt_hyperbolabsd.go
  6452. new file mode 100644
  6453. index 0000000..5b90893
  6454. --- /dev/null
  6455. +++ b/libgo/go/net/tcpsockopt_hyperbolabsd.go
  6456. @@ -0,0 +1,20 @@
  6457. +// Copyright 2009 The Go Authors. All rights reserved.
  6458. +//
  6459. +// Modifications to support HyperbolaBSD:
  6460. +// Copyright (C) 2020-2024 Hyperbola Project
  6461. +//
  6462. +// Use of this source code is governed by a BSD-style
  6463. +// license that can be found in the LICENSE file.
  6464. +
  6465. +package net
  6466. +
  6467. +import (
  6468. + "syscall"
  6469. + "time"
  6470. +)
  6471. +
  6472. +func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
  6473. + // HyperbolaBSD has no user-settable per-socket TCP keepalive
  6474. + // options.
  6475. + return syscall.ENOPROTOOPT
  6476. +}
  6477. diff --git a/libgo/go/net/tcpsockopt_posix.go b/libgo/go/net/tcpsockopt_posix.go
  6478. index 5e00ba1..3aacb33 100644
  6479. --- a/libgo/go/net/tcpsockopt_posix.go
  6480. +++ b/libgo/go/net/tcpsockopt_posix.go
  6481. @@ -1,8 +1,12 @@
  6482. // Copyright 2009 The Go Authors. All rights reserved.
  6483. +//
  6484. +// Modifications to support HyperbolaBSD:
  6485. +// Copyright (C) 2020-2024 Hyperbola Project
  6486. +//
  6487. // Use of this source code is governed by a BSD-style
  6488. // license that can be found in the LICENSE file.
  6489. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
  6490. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris windows
  6491. package net
  6492. diff --git b/libgo/go/net/testdata/hyperbolabsd-resolv.conf b/libgo/go/net/testdata/hyperbolabsd-resolv.conf
  6493. new file mode 100644
  6494. index 0000000..8281a91
  6495. --- /dev/null
  6496. +++ b/libgo/go/net/testdata/hyperbolabsd-resolv.conf
  6497. @@ -0,0 +1,5 @@
  6498. +# Generated by vio0 dhclient
  6499. +search c.symbolic-datum-552.internal.
  6500. +nameserver 169.254.169.254
  6501. +nameserver 10.240.0.1
  6502. +lookup file bind
  6503. diff --git a/libgo/go/net/timeout_test.go b/libgo/go/net/timeout_test.go
  6504. index 9de7801..84b6346 100644
  6505. --- a/libgo/go/net/timeout_test.go
  6506. +++ b/libgo/go/net/timeout_test.go
  6507. @@ -1,4 +1,8 @@
  6508. // Copyright 2009 The Go Authors. All rights reserved.
  6509. +//
  6510. +// Modifications to support HyperbolaBSD:
  6511. +// Copyright (C) 2020-2024 Hyperbola Project
  6512. +//
  6513. // Use of this source code is governed by a BSD-style
  6514. // license that can be found in the LICENSE file.
  6515. @@ -102,6 +106,8 @@ var dialTimeoutMaxDurationTests = []struct {
  6516. func TestDialTimeoutMaxDuration(t *testing.T) {
  6517. if runtime.GOOS == "openbsd" {
  6518. testenv.SkipFlaky(t, 15157)
  6519. + } else if runtime.GOOS == "hyperbolabsd" {
  6520. + testenv.SkipFlaky(t, 15157)
  6521. }
  6522. ln, err := newLocalListener("tcp")
  6523. diff --git a/libgo/go/net/udpsock_posix.go b/libgo/go/net/udpsock_posix.go
  6524. index fe552ba..625f830 100644
  6525. --- a/libgo/go/net/udpsock_posix.go
  6526. +++ b/libgo/go/net/udpsock_posix.go
  6527. @@ -1,8 +1,12 @@
  6528. // Copyright 2009 The Go Authors. All rights reserved.
  6529. +//
  6530. +// Modifications to support HyperbolaBSD:
  6531. +// Copyright (C) 2020-2024 Hyperbola Project
  6532. +//
  6533. // Use of this source code is governed by a BSD-style
  6534. // license that can be found in the LICENSE file.
  6535. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6536. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6537. package net
  6538. diff --git a/libgo/go/net/unixsock_posix.go b/libgo/go/net/unixsock_posix.go
  6539. index 945aa03..d44219d 100644
  6540. --- a/libgo/go/net/unixsock_posix.go
  6541. +++ b/libgo/go/net/unixsock_posix.go
  6542. @@ -1,8 +1,12 @@
  6543. // Copyright 2009 The Go Authors. All rights reserved.
  6544. +//
  6545. +// Modifications to support HyperbolaBSD:
  6546. +// Copyright (C) 2020-2024 Hyperbola Project
  6547. +//
  6548. // Use of this source code is governed by a BSD-style
  6549. // license that can be found in the LICENSE file.
  6550. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6551. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6552. package net
  6553. diff --git a/libgo/go/net/unixsock_test.go b/libgo/go/net/unixsock_test.go
  6554. index 3e5c8bc..5230ee9 100644
  6555. --- a/libgo/go/net/unixsock_test.go
  6556. +++ b/libgo/go/net/unixsock_test.go
  6557. @@ -1,4 +1,8 @@
  6558. // Copyright 2013 The Go Authors. All rights reserved.
  6559. +//
  6560. +// Modifications to support HyperbolaBSD:
  6561. +// Copyright (C) 2020-2024 Hyperbola Project
  6562. +//
  6563. // Use of this source code is governed by a BSD-style
  6564. // license that can be found in the LICENSE file.
  6565. @@ -24,6 +28,8 @@ func TestReadUnixgramWithUnnamedSocket(t *testing.T) {
  6566. }
  6567. if runtime.GOOS == "openbsd" {
  6568. testenv.SkipFlaky(t, 15157)
  6569. + } else if runtime.GOOS == "hyperbolabsd" {
  6570. + testenv.SkipFlaky(t, 15157)
  6571. }
  6572. addr := testUnixAddr()
  6573. diff --git a/libgo/go/net/write_unix_test.go b/libgo/go/net/write_unix_test.go
  6574. index 6d8cb6a..bcb1560 100644
  6575. --- a/libgo/go/net/write_unix_test.go
  6576. +++ b/libgo/go/net/write_unix_test.go
  6577. @@ -1,8 +1,12 @@
  6578. // Copyright 2017 The Go Authors. All rights reserved.
  6579. +//
  6580. +// Modifications to support HyperbolaBSD:
  6581. +// Copyright (C) 2020-2024 Hyperbola Project
  6582. +//
  6583. // Use of this source code is governed by a BSD-style
  6584. // license that can be found in the LICENSE file.
  6585. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  6586. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6587. package net
  6588. diff --git a/libgo/go/net/writev_test.go b/libgo/go/net/writev_test.go
  6589. index 4c05be4..cf7e558 100644
  6590. --- a/libgo/go/net/writev_test.go
  6591. +++ b/libgo/go/net/writev_test.go
  6592. @@ -1,4 +1,8 @@
  6593. // Copyright 2016 The Go Authors. All rights reserved.
  6594. +//
  6595. +// Modifications to support HyperbolaBSD:
  6596. +// Copyright (C) 2020-2024 Hyperbola Project
  6597. +//
  6598. // Use of this source code is governed by a BSD-style
  6599. // license that can be found in the LICENSE file.
  6600. @@ -152,7 +156,7 @@ func testBuffer_writeTo(t *testing.T, chunks int, useCopy bool) {
  6601. var wantSum int
  6602. switch runtime.GOOS {
  6603. - case "android", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd":
  6604. + case "android", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd":
  6605. var wantMinCalls int
  6606. wantSum = want.Len()
  6607. v := chunks
  6608. diff --git a/libgo/go/net/writev_unix.go b/libgo/go/net/writev_unix.go
  6609. index bf0fbf8..c98bd9c 100644
  6610. --- a/libgo/go/net/writev_unix.go
  6611. +++ b/libgo/go/net/writev_unix.go
  6612. @@ -1,8 +1,12 @@
  6613. // Copyright 2016 The Go Authors. All rights reserved.
  6614. +//
  6615. +// Modifications to support HyperbolaBSD:
  6616. +// Copyright (C) 2020-2024 Hyperbola Project
  6617. +//
  6618. // Use of this source code is governed by a BSD-style
  6619. // license that can be found in the LICENSE file.
  6620. -// +build darwin dragonfly freebsd linux netbsd openbsd
  6621. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd
  6622. package net
  6623. diff --git a/libgo/go/os/dir_unix.go b/libgo/go/os/dir_unix.go
  6624. index 2dc6a89..40875df 100644
  6625. --- a/libgo/go/os/dir_unix.go
  6626. +++ b/libgo/go/os/dir_unix.go
  6627. @@ -1,8 +1,12 @@
  6628. // Copyright 2009 The Go Authors. All rights reserved.
  6629. +//
  6630. +// Modifications to support HyperbolaBSD:
  6631. +// Copyright (C) 2020-2024 Hyperbola Project
  6632. +//
  6633. // Use of this source code is governed by a BSD-style
  6634. // license that can be found in the LICENSE file.
  6635. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6636. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6637. package os
  6638. diff --git a/libgo/go/os/env_unix_test.go b/libgo/go/os/env_unix_test.go
  6639. index f7b67eb..3dda1a5 100644
  6640. --- a/libgo/go/os/env_unix_test.go
  6641. +++ b/libgo/go/os/env_unix_test.go
  6642. @@ -1,8 +1,12 @@
  6643. // Copyright 2013 The Go Authors. All rights reserved.
  6644. +//
  6645. +// Modifications to support HyperbolaBSD:
  6646. +// Copyright (C) 2020-2024 Hyperbola Project
  6647. +//
  6648. // Use of this source code is governed by a BSD-style
  6649. // license that can be found in the LICENSE file.
  6650. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  6651. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6652. package os_test
  6653. diff --git a/libgo/go/os/error_posix.go b/libgo/go/os/error_posix.go
  6654. index 2049e44..23f490a 100644
  6655. --- a/libgo/go/os/error_posix.go
  6656. +++ b/libgo/go/os/error_posix.go
  6657. @@ -1,8 +1,12 @@
  6658. // Copyright 2017 The Go Authors. All rights reserved.
  6659. +//
  6660. +// Modifications to support HyperbolaBSD:
  6661. +// Copyright (C) 2020-2024 Hyperbola Project
  6662. +//
  6663. // Use of this source code is governed by a BSD-style
  6664. // license that can be found in the LICENSE file.
  6665. -// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6666. +// +build darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6667. package os
  6668. diff --git a/libgo/go/os/error_unix.go b/libgo/go/os/error_unix.go
  6669. index 2349851..6a62d66 100644
  6670. --- a/libgo/go/os/error_unix.go
  6671. +++ b/libgo/go/os/error_unix.go
  6672. @@ -1,8 +1,12 @@
  6673. // Copyright 2009 The Go Authors. All rights reserved.
  6674. +//
  6675. +// Modifications to support HyperbolaBSD:
  6676. +// Copyright (C) 2020-2024 Hyperbola Project
  6677. +//
  6678. // Use of this source code is governed by a BSD-style
  6679. // license that can be found in the LICENSE file.
  6680. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6681. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6682. package os
  6683. diff --git a/libgo/go/os/error_unix_test.go b/libgo/go/os/error_unix_test.go
  6684. index 76fe015..484df8b 100644
  6685. --- a/libgo/go/os/error_unix_test.go
  6686. +++ b/libgo/go/os/error_unix_test.go
  6687. @@ -1,8 +1,12 @@
  6688. // Copyright 2016 The Go Authors. All rights reserved.
  6689. +//
  6690. +// Modifications to support HyperbolaBSD:
  6691. +// Copyright (C) 2020-2024 Hyperbola Project
  6692. +//
  6693. // Use of this source code is governed by a BSD-style
  6694. // license that can be found in the LICENSE file.
  6695. -// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6696. +// +build darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6697. package os_test
  6698. diff --git a/libgo/go/os/exec/exec_posix_test.go b/libgo/go/os/exec/exec_posix_test.go
  6699. index 865b6c3..6e7a19c 100644
  6700. --- a/libgo/go/os/exec/exec_posix_test.go
  6701. +++ b/libgo/go/os/exec/exec_posix_test.go
  6702. @@ -1,8 +1,12 @@
  6703. // Copyright 2017 The Go Authors. All rights reserved.
  6704. +//
  6705. +// Modifications to support HyperbolaBSD:
  6706. +// Copyright (C) 2020-2024 Hyperbola Project
  6707. +//
  6708. // Use of this source code is governed by a BSD-style
  6709. // license that can be found in the LICENSE file.
  6710. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  6711. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6712. package exec_test
  6713. diff --git a/libgo/go/os/exec/exec_test.go b/libgo/go/os/exec/exec_test.go
  6714. index aa33570..e27ae94 100644
  6715. --- a/libgo/go/os/exec/exec_test.go
  6716. +++ b/libgo/go/os/exec/exec_test.go
  6717. @@ -1,4 +1,8 @@
  6718. // Copyright 2009 The Go Authors. All rights reserved.
  6719. +//
  6720. +// Modifications to support HyperbolaBSD:
  6721. +// Copyright (C) 2020-2024 Hyperbola Project
  6722. +//
  6723. // Use of this source code is governed by a BSD-style
  6724. // license that can be found in the LICENSE file.
  6725. @@ -676,7 +680,7 @@ func TestHelperProcess(*testing.T) {
  6726. // Determine which command to use to display open files.
  6727. ofcmd := "lsof"
  6728. switch runtime.GOOS {
  6729. - case "dragonfly", "freebsd", "netbsd", "openbsd":
  6730. + case "dragonfly", "freebsd", "netbsd", "openbsd", "hyperbolabsd":
  6731. ofcmd = "fstat"
  6732. case "plan9":
  6733. ofcmd = "/bin/cat"
  6734. diff --git a/libgo/go/os/exec/lp_unix.go b/libgo/go/os/exec/lp_unix.go
  6735. index 20ce7a4..d4590f2 100644
  6736. --- a/libgo/go/os/exec/lp_unix.go
  6737. +++ b/libgo/go/os/exec/lp_unix.go
  6738. @@ -1,8 +1,12 @@
  6739. // Copyright 2010 The Go Authors. All rights reserved.
  6740. +//
  6741. +// Modifications to support HyperbolaBSD:
  6742. +// Copyright (C) 2020-2024 Hyperbola Project
  6743. +//
  6744. // Use of this source code is governed by a BSD-style
  6745. // license that can be found in the LICENSE file.
  6746. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6747. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6748. package exec
  6749. diff --git a/libgo/go/os/exec/lp_unix_test.go b/libgo/go/os/exec/lp_unix_test.go
  6750. index d467acf..e514f18 100644
  6751. --- a/libgo/go/os/exec/lp_unix_test.go
  6752. +++ b/libgo/go/os/exec/lp_unix_test.go
  6753. @@ -1,8 +1,12 @@
  6754. // Copyright 2013 The Go Authors. All rights reserved.
  6755. +//
  6756. +// Modifications to support HyperbolaBSD:
  6757. +// Copyright (C) 2020-2024 Hyperbola Project
  6758. +//
  6759. // Use of this source code is governed by a BSD-style
  6760. // license that can be found in the LICENSE file.
  6761. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  6762. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6763. package exec
  6764. diff --git a/libgo/go/os/exec_posix.go b/libgo/go/os/exec_posix.go
  6765. index 056f139..87d1bcf 100644
  6766. --- a/libgo/go/os/exec_posix.go
  6767. +++ b/libgo/go/os/exec_posix.go
  6768. @@ -1,8 +1,12 @@
  6769. // Copyright 2009 The Go Authors. All rights reserved.
  6770. +//
  6771. +// Modifications to support HyperbolaBSD:
  6772. +// Copyright (C) 2020-2024 Hyperbola Project
  6773. +//
  6774. // Use of this source code is governed by a BSD-style
  6775. // license that can be found in the LICENSE file.
  6776. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6777. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6778. package os
  6779. diff --git a/libgo/go/os/exec_unix.go b/libgo/go/os/exec_unix.go
  6780. index d6433bf..6de906d 100644
  6781. --- a/libgo/go/os/exec_unix.go
  6782. +++ b/libgo/go/os/exec_unix.go
  6783. @@ -1,8 +1,12 @@
  6784. // Copyright 2009 The Go Authors. All rights reserved.
  6785. +//
  6786. +// Modifications to support HyperbolaBSD:
  6787. +// Copyright (C) 2020-2024 Hyperbola Project
  6788. +//
  6789. // Use of this source code is governed by a BSD-style
  6790. // license that can be found in the LICENSE file.
  6791. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6792. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6793. package os
  6794. diff --git a/libgo/go/os/executable_path.go b/libgo/go/os/executable_path.go
  6795. index 7b8b836..39c991a 100644
  6796. --- a/libgo/go/os/executable_path.go
  6797. +++ b/libgo/go/os/executable_path.go
  6798. @@ -1,8 +1,12 @@
  6799. // Copyright 2017 The Go Authors. All rights reserved.
  6800. +//
  6801. +// Modifications to support HyperbolaBSD:
  6802. +// Copyright (C) 2020-2024 Hyperbola Project
  6803. +//
  6804. // Use of this source code is governed by a BSD-style
  6805. // license that can be found in the LICENSE file.
  6806. -// +build aix openbsd
  6807. +// +build aix openbsd hyperbolabsd
  6808. package os
  6809. diff --git a/libgo/go/os/executable_test.go b/libgo/go/os/executable_test.go
  6810. index 4a9a883..bfc93c7 100644
  6811. --- a/libgo/go/os/executable_test.go
  6812. +++ b/libgo/go/os/executable_test.go
  6813. @@ -1,4 +1,8 @@
  6814. // Copyright 2016 The Go Authors. All rights reserved.
  6815. +//
  6816. +// Modifications to support HyperbolaBSD:
  6817. +// Copyright (C) 2020-2024 Hyperbola Project
  6818. +//
  6819. // Use of this source code is governed by a BSD-style
  6820. // license that can be found in the LICENSE file.
  6821. @@ -39,6 +43,9 @@ func TestExecutable(t *testing.T) {
  6822. if runtime.GOOS == "openbsd" {
  6823. // OpenBSD relies on argv[0]
  6824. cmd.Args[0] = fn
  6825. + } else if runtime.GOOS == "hyperbolabsd" {
  6826. + // HyperbolaBSD relies on argv[0]
  6827. + cmd.Args[0] = fn
  6828. }
  6829. cmd.Env = append(os.Environ(), fmt.Sprintf("%s=1", executable_EnvVar))
  6830. out, err := cmd.CombinedOutput()
  6831. diff --git a/libgo/go/os/file_posix.go b/libgo/go/os/file_posix.go
  6832. index 67da384..ad7fc9a 100644
  6833. --- a/libgo/go/os/file_posix.go
  6834. +++ b/libgo/go/os/file_posix.go
  6835. @@ -1,8 +1,12 @@
  6836. // Copyright 2009 The Go Authors. All rights reserved.
  6837. +//
  6838. +// Modifications to support HyperbolaBSD:
  6839. +// Copyright (C) 2020-2024 Hyperbola Project
  6840. +//
  6841. // Use of this source code is governed by a BSD-style
  6842. // license that can be found in the LICENSE file.
  6843. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6844. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6845. package os
  6846. diff --git a/libgo/go/os/file_unix.go b/libgo/go/os/file_unix.go
  6847. index 67d2ee1..f00220c 100644
  6848. --- a/libgo/go/os/file_unix.go
  6849. +++ b/libgo/go/os/file_unix.go
  6850. @@ -1,8 +1,12 @@
  6851. // Copyright 2009 The Go Authors. All rights reserved.
  6852. +//
  6853. +// Modifications to support HyperbolaBSD:
  6854. +// Copyright (C) 2020-2024 Hyperbola Project
  6855. +//
  6856. // Use of this source code is governed by a BSD-style
  6857. // license that can be found in the LICENSE file.
  6858. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6859. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6860. package os
  6861. diff --git a/libgo/go/os/os_test.go b/libgo/go/os/os_test.go
  6862. index 8ed9252..9554544 100644
  6863. --- a/libgo/go/os/os_test.go
  6864. +++ b/libgo/go/os/os_test.go
  6865. @@ -1,4 +1,8 @@
  6866. // Copyright 2009 The Go Authors. All rights reserved.
  6867. +//
  6868. +// Modifications to support HyperbolaBSD:
  6869. +// Copyright (C) 2020-2024 Hyperbola Project
  6870. +//
  6871. // Use of this source code is governed by a BSD-style
  6872. // license that can be found in the LICENSE file.
  6873. @@ -2225,9 +2229,11 @@ func TestPipeThreads(t *testing.T) {
  6874. threads := 100
  6875. - // OpenBSD has a low default for max number of files.
  6876. + // OpenBSD (and HyperbolaBSD) has a low default for max number of files.
  6877. if runtime.GOOS == "openbsd" {
  6878. threads = 50
  6879. + } else if runtime.GOOS == "hyperbolabsd" {
  6880. + threads = 50
  6881. }
  6882. r := make([]*File, threads)
  6883. diff --git a/libgo/go/os/os_unix_test.go b/libgo/go/os/os_unix_test.go
  6884. index 56c885c..1269eb6 100644
  6885. --- a/libgo/go/os/os_unix_test.go
  6886. +++ b/libgo/go/os/os_unix_test.go
  6887. @@ -1,8 +1,12 @@
  6888. // Copyright 2009 The Go Authors. All rights reserved.
  6889. +//
  6890. +// Modifications to support HyperbolaBSD:
  6891. +// Copyright (C) 2020-2024 Hyperbola Project
  6892. +//
  6893. // Use of this source code is governed by a BSD-style
  6894. // license that can be found in the LICENSE file.
  6895. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  6896. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6897. package os_test
  6898. diff --git a/libgo/go/os/path_unix.go b/libgo/go/os/path_unix.go
  6899. index bc0f239..f5e67b0 100644
  6900. --- a/libgo/go/os/path_unix.go
  6901. +++ b/libgo/go/os/path_unix.go
  6902. @@ -1,8 +1,12 @@
  6903. // Copyright 2011 The Go Authors. All rights reserved.
  6904. +//
  6905. +// Modifications to support HyperbolaBSD:
  6906. +// Copyright (C) 2020-2024 Hyperbola Project
  6907. +//
  6908. // Use of this source code is governed by a BSD-style
  6909. // license that can be found in the LICENSE file.
  6910. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  6911. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  6912. package os
  6913. diff --git a/libgo/go/os/pipe_bsd.go b/libgo/go/os/pipe_bsd.go
  6914. index 8398a24..14e6ef6 100644
  6915. --- a/libgo/go/os/pipe_bsd.go
  6916. +++ b/libgo/go/os/pipe_bsd.go
  6917. @@ -1,8 +1,12 @@
  6918. // Copyright 2009 The Go Authors. All rights reserved.
  6919. +//
  6920. +// Modifications to support HyperbolaBSD:
  6921. +// Copyright (C) 2020-2024 Hyperbola Project
  6922. +//
  6923. // Use of this source code is governed by a BSD-style
  6924. // license that can be found in the LICENSE file.
  6925. -// +build aix darwin dragonfly nacl netbsd openbsd solaris
  6926. +// +build aix darwin dragonfly nacl netbsd openbsd hyperbolabsd solaris
  6927. package os
  6928. diff --git a/libgo/go/os/signal/internal/pty/pty.go b/libgo/go/os/signal/internal/pty/pty.go
  6929. index e52d19a..87708c7 100644
  6930. --- a/libgo/go/os/signal/internal/pty/pty.go
  6931. +++ b/libgo/go/os/signal/internal/pty/pty.go
  6932. @@ -1,8 +1,12 @@
  6933. // Copyright 2017 The Go Authors. All rights reserved.
  6934. +//
  6935. +// Modifications to support HyperbolaBSD:
  6936. +// Copyright (C) 2020-2024 Hyperbola Project
  6937. +//
  6938. // Use of this source code is governed by a BSD-style
  6939. // license that can be found in the LICENSE file.
  6940. -// +build aix darwin dragonfly freebsd linux,!android netbsd openbsd solaris
  6941. +// +build aix darwin dragonfly freebsd linux,!android netbsd openbsd hyperbolabsd solaris
  6942. // Package pty is a simple pseudo-terminal package for Unix systems,
  6943. // implemented by calling C functions via cgo.
  6944. diff --git a/libgo/go/os/signal/signal_cgo_test.go b/libgo/go/os/signal/signal_cgo_test.go
  6945. index 16aeea8..a99ec3a 100644
  6946. --- a/libgo/go/os/signal/signal_cgo_test.go
  6947. +++ b/libgo/go/os/signal/signal_cgo_test.go
  6948. @@ -1,8 +1,12 @@
  6949. // Copyright 2017 The Go Authors. All rights reserved.
  6950. +//
  6951. +// Modifications to support HyperbolaBSD:
  6952. +// Copyright (C) 2020-2024 Hyperbola Project
  6953. +//
  6954. // Use of this source code is governed by a BSD-style
  6955. // license that can be found in the LICENSE file.
  6956. -// +build darwin dragonfly freebsd linux,!android netbsd openbsd
  6957. +// +build darwin dragonfly freebsd linux,!android netbsd openbsd hyperbolabsd
  6958. // +build cgo
  6959. // Note that this test does not work on Solaris: issue #22849.
  6960. diff --git a/libgo/go/os/signal/signal_test.go b/libgo/go/os/signal/signal_test.go
  6961. index d27ff0b..035a781 100644
  6962. --- a/libgo/go/os/signal/signal_test.go
  6963. +++ b/libgo/go/os/signal/signal_test.go
  6964. @@ -1,8 +1,12 @@
  6965. // Copyright 2009 The Go Authors. All rights reserved.
  6966. +//
  6967. +// Modifications to support HyperbolaBSD:
  6968. +// Copyright (C) 2020-2024 Hyperbola Project
  6969. +//
  6970. // Use of this source code is governed by a BSD-style
  6971. // license that can be found in the LICENSE file.
  6972. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  6973. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  6974. package signal
  6975. diff --git a/libgo/go/os/signal/signal_unix.go b/libgo/go/os/signal/signal_unix.go
  6976. index 5ec7e97..f93d44d 100644
  6977. --- a/libgo/go/os/signal/signal_unix.go
  6978. +++ b/libgo/go/os/signal/signal_unix.go
  6979. @@ -1,8 +1,12 @@
  6980. // Copyright 2012 The Go Authors. All rights reserved.
  6981. +//
  6982. +// Modifications to support HyperbolaBSD:
  6983. +// Copyright (C) 2020-2024 Hyperbola Project
  6984. +//
  6985. // Use of this source code is governed by a BSD-style
  6986. // license that can be found in the LICENSE file.
  6987. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  6988. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  6989. package signal
  6990. diff --git a/libgo/go/os/stat_atim.go b/libgo/go/os/stat_atim.go
  6991. index ef8a574..bf64005 100644
  6992. --- a/libgo/go/os/stat_atim.go
  6993. +++ b/libgo/go/os/stat_atim.go
  6994. @@ -1,8 +1,12 @@
  6995. // Copyright 2009 The Go Authors. All rights reserved.
  6996. +//
  6997. +// Modifications to support HyperbolaBSD:
  6998. +// Copyright (C) 2020-2024 Hyperbola Project
  6999. +//
  7000. // Use of this source code is governed by a BSD-style
  7001. // license that can be found in the LICENSE file.
  7002. -// +build linux openbsd solaristag
  7003. +// +build linux openbsd hyperbolabsd solaristag
  7004. package os
  7005. diff --git a/libgo/go/os/stat_unix.go b/libgo/go/os/stat_unix.go
  7006. index bc5d06c..12aa701 100644
  7007. --- a/libgo/go/os/stat_unix.go
  7008. +++ b/libgo/go/os/stat_unix.go
  7009. @@ -1,8 +1,12 @@
  7010. // Copyright 2016 The Go Authors. All rights reserved.
  7011. +//
  7012. +// Modifications to support HyperbolaBSD:
  7013. +// Copyright (C) 2020-2024 Hyperbola Project
  7014. +//
  7015. // Use of this source code is governed by a BSD-style
  7016. // license that can be found in the LICENSE file.
  7017. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  7018. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  7019. package os
  7020. diff --git a/libgo/go/os/sticky_bsd.go b/libgo/go/os/sticky_bsd.go
  7021. index 6b54c75..41c08fc 100644
  7022. --- a/libgo/go/os/sticky_bsd.go
  7023. +++ b/libgo/go/os/sticky_bsd.go
  7024. @@ -1,8 +1,12 @@
  7025. // Copyright 2014 The Go Authors. All rights reserved.
  7026. +//
  7027. +// Modifications to support HyperbolaBSD:
  7028. +// Copyright (C) 2020-2024 Hyperbola Project
  7029. +//
  7030. // Use of this source code is governed by a BSD-style
  7031. // license that can be found in the LICENSE file.
  7032. -// +build darwin dragonfly freebsd netbsd openbsd solaris
  7033. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd solaris
  7034. package os
  7035. diff --git a/libgo/go/os/sticky_notbsd.go b/libgo/go/os/sticky_notbsd.go
  7036. index 834e79b..182271b 100644
  7037. --- a/libgo/go/os/sticky_notbsd.go
  7038. +++ b/libgo/go/os/sticky_notbsd.go
  7039. @@ -1,4 +1,8 @@
  7040. // Copyright 2014 The Go Authors. All rights reserved.
  7041. +//
  7042. +// Modifications to support HyperbolaBSD:
  7043. +// Copyright (C) 2020-2024 Hyperbola Project
  7044. +//
  7045. // Use of this source code is governed by a BSD-style
  7046. // license that can be found in the LICENSE file.
  7047. @@ -7,6 +11,7 @@
  7048. // +build !freebsd
  7049. // +build !netbsd
  7050. // +build !openbsd
  7051. +// +build !hyperbolabsd
  7052. // +build !solaris
  7053. package os
  7054. diff --git a/libgo/go/os/sys_bsd.go b/libgo/go/os/sys_bsd.go
  7055. index 8ad5e21..de090bc 100644
  7056. --- a/libgo/go/os/sys_bsd.go
  7057. +++ b/libgo/go/os/sys_bsd.go
  7058. @@ -1,8 +1,12 @@
  7059. // Copyright 2009 The Go Authors. All rights reserved.
  7060. +//
  7061. +// Modifications to support HyperbolaBSD:
  7062. +// Copyright (C) 2020-2024 Hyperbola Project
  7063. +//
  7064. // Use of this source code is governed by a BSD-style
  7065. // license that can be found in the LICENSE file.
  7066. -// +build darwin dragonfly freebsd nacl netbsd openbsd
  7067. +// +build darwin dragonfly freebsd nacl netbsd openbsd hyperbolabsd
  7068. // os code shared between *BSD systems including OS X (Darwin)
  7069. // and FreeBSD.
  7070. diff --git a/libgo/go/os/sys_unix.go b/libgo/go/os/sys_unix.go
  7071. index 4caf8bd..f6e2d28 100644
  7072. --- a/libgo/go/os/sys_unix.go
  7073. +++ b/libgo/go/os/sys_unix.go
  7074. @@ -1,8 +1,12 @@
  7075. // Copyright 2014 The Go Authors. All rights reserved.
  7076. +//
  7077. +// Modifications to support HyperbolaBSD:
  7078. +// Copyright (C) 2020-2024 Hyperbola Project
  7079. +//
  7080. // Use of this source code is governed by a BSD-style
  7081. // license that can be found in the LICENSE file.
  7082. -// +build aix dragonfly linux netbsd openbsd solaris
  7083. +// +build aix dragonfly linux netbsd openbsd hyperbolabsd solaris
  7084. package os
  7085. diff --git a/libgo/go/os/user/cgo_lookup_unix.go b/libgo/go/os/user/cgo_lookup_unix.go
  7086. index 6c815b4..14441d5 100644
  7087. --- a/libgo/go/os/user/cgo_lookup_unix.go
  7088. +++ b/libgo/go/os/user/cgo_lookup_unix.go
  7089. @@ -1,8 +1,12 @@
  7090. // Copyright 2011 The Go Authors. All rights reserved.
  7091. +//
  7092. +// Modifications to support HyperbolaBSD:
  7093. +// Copyright (C) 2020-2024 Hyperbola Project
  7094. +//
  7095. // Use of this source code is governed by a BSD-style
  7096. // license that can be found in the LICENSE file.
  7097. -// +build aix darwin dragonfly freebsd !android,linux netbsd openbsd solaris
  7098. +// +build aix darwin dragonfly freebsd !android,linux netbsd openbsd hyperbolabsd solaris
  7099. // +build cgo
  7100. package user
  7101. diff --git a/libgo/go/os/user/cgo_unix_test.go b/libgo/go/os/user/cgo_unix_test.go
  7102. index 6741118..31f69d5 100644
  7103. --- a/libgo/go/os/user/cgo_unix_test.go
  7104. +++ b/libgo/go/os/user/cgo_unix_test.go
  7105. @@ -1,8 +1,12 @@
  7106. // Copyright 2017 The Go Authors. All rights reserved.
  7107. +//
  7108. +// Modifications to support HyperbolaBSD:
  7109. +// Copyright (C) 2020-2024 Hyperbola Project
  7110. +//
  7111. // Use of this source code is governed by a BSD-style
  7112. // license that can be found in the LICENSE file.
  7113. -// +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris
  7114. +// +build darwin dragonfly freebsd !android,linux netbsd openbsd hyperbolabsd solaris
  7115. // +build cgo
  7116. package user
  7117. diff --git a/libgo/go/os/user/decls_unix.go b/libgo/go/os/user/decls_unix.go
  7118. index c2eb51e..c965bcb 100644
  7119. --- a/libgo/go/os/user/decls_unix.go
  7120. +++ b/libgo/go/os/user/decls_unix.go
  7121. @@ -1,8 +1,12 @@
  7122. // Copyright 2014 The Go Authors. All rights reserved.
  7123. +//
  7124. +// Modifications to support HyperbolaBSD:
  7125. +// Copyright (C) 2020-2024 Hyperbola Project
  7126. +//
  7127. // Use of this source code is governed by a BSD-style
  7128. // license that can be found in the LICENSE file.
  7129. -// +build darwin dragonfly freebsd linux netbsd openbsd
  7130. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd
  7131. // +build cgo
  7132. package user
  7133. diff --git a/libgo/go/os/user/listgroups_unix.go b/libgo/go/os/user/listgroups_unix.go
  7134. index b142e2b..f196f11 100644
  7135. --- a/libgo/go/os/user/listgroups_unix.go
  7136. +++ b/libgo/go/os/user/listgroups_unix.go
  7137. @@ -1,8 +1,12 @@
  7138. // Copyright 2016 The Go Authors. All rights reserved.
  7139. +//
  7140. +// Modifications to support HyperbolaBSD:
  7141. +// Copyright (C) 2020-2024 Hyperbola Project
  7142. +//
  7143. // Use of this source code is governed by a BSD-style
  7144. // license that can be found in the LICENSE file.
  7145. -// +build dragonfly darwin freebsd !android,linux netbsd openbsd
  7146. +// +build dragonfly darwin freebsd !android,linux netbsd openbsd hyperbolabsd
  7147. package user
  7148. diff --git a/libgo/go/os/user/lookup_unix.go b/libgo/go/os/user/lookup_unix.go
  7149. index 5f34ba8..5797707 100644
  7150. --- a/libgo/go/os/user/lookup_unix.go
  7151. +++ b/libgo/go/os/user/lookup_unix.go
  7152. @@ -1,8 +1,12 @@
  7153. // Copyright 2016 The Go Authors. All rights reserved.
  7154. +//
  7155. +// Modifications to support HyperbolaBSD:
  7156. +// Copyright (C) 2020-2024 Hyperbola Project
  7157. +//
  7158. // Use of this source code is governed by a BSD-style
  7159. // license that can be found in the LICENSE file.
  7160. -// +build darwin dragonfly freebsd !android,linux nacl netbsd openbsd solaris
  7161. +// +build darwin dragonfly freebsd !android,linux nacl netbsd openbsd hyperbolabsd solaris
  7162. // +build !cgo
  7163. package user
  7164. diff --git a/libgo/go/os/user/lookup_unix_test.go b/libgo/go/os/user/lookup_unix_test.go
  7165. index 02c88ab..5b22d94 100644
  7166. --- a/libgo/go/os/user/lookup_unix_test.go
  7167. +++ b/libgo/go/os/user/lookup_unix_test.go
  7168. @@ -1,8 +1,12 @@
  7169. // Copyright 2016 The Go Authors. All rights reserved.
  7170. +//
  7171. +// Modifications to support HyperbolaBSD:
  7172. +// Copyright (C) 2020-2024 Hyperbola Project
  7173. +//
  7174. // Use of this source code is governed by a BSD-style
  7175. // license that can be found in the LICENSE file.
  7176. -// +build darwin dragonfly freebsd !android,linux nacl netbsd openbsd solaris
  7177. +// +build darwin dragonfly freebsd !android,linux nacl netbsd openbsd hyperbolabsd solaris
  7178. // +build !cgo
  7179. package user
  7180. diff --git a/libgo/go/os/wait_unimp.go b/libgo/go/os/wait_unimp.go
  7181. index 98243b5..2e979e0 100644
  7182. --- a/libgo/go/os/wait_unimp.go
  7183. +++ b/libgo/go/os/wait_unimp.go
  7184. @@ -1,8 +1,12 @@
  7185. // Copyright 2016 The Go Authors. All rights reserved.
  7186. +//
  7187. +// Modifications to support HyperbolaBSD:
  7188. +// Copyright (C) 2020-2024 Hyperbola Project
  7189. +//
  7190. // Use of this source code is governed by a BSD-style
  7191. // license that can be found in the LICENSE file.
  7192. -// +build aix darwin dragonfly nacl netbsd openbsd solaris
  7193. +// +build aix darwin dragonfly nacl netbsd openbsd hyperbolabsd solaris
  7194. package os
  7195. diff --git a/libgo/go/path/filepath/path_unix.go b/libgo/go/path/filepath/path_unix.go
  7196. index 2d407a8..38d63da 100644
  7197. --- a/libgo/go/path/filepath/path_unix.go
  7198. +++ b/libgo/go/path/filepath/path_unix.go
  7199. @@ -1,8 +1,12 @@
  7200. // Copyright 2010 The Go Authors. All rights reserved.
  7201. +//
  7202. +// Modifications to support HyperbolaBSD:
  7203. +// Copyright (C) 2020-2024 Hyperbola Project
  7204. +//
  7205. // Use of this source code is governed by a BSD-style
  7206. // license that can be found in the LICENSE file.
  7207. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  7208. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  7209. package filepath
  7210. diff --git a/libgo/go/runtime/crash_unix_test.go b/libgo/go/runtime/crash_unix_test.go
  7211. index 584a6c7..35eb901 100644
  7212. --- a/libgo/go/runtime/crash_unix_test.go
  7213. +++ b/libgo/go/runtime/crash_unix_test.go
  7214. @@ -1,8 +1,12 @@
  7215. // Copyright 2012 The Go Authors. All rights reserved.
  7216. +//
  7217. +// Modifications to support HyperbolaBSD:
  7218. +// Copyright (C) 2020-2024 Hyperbola Project
  7219. +//
  7220. // Use of this source code is governed by a BSD-style
  7221. // license that can be found in the LICENSE file.
  7222. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7223. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7224. package runtime_test
  7225. @@ -35,7 +39,7 @@ func init() {
  7226. func TestCrashDumpsAllThreads(t *testing.T) {
  7227. switch runtime.GOOS {
  7228. - case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris":
  7229. + case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd", "solaris":
  7230. default:
  7231. t.Skipf("skipping; not supported on %v", runtime.GOOS)
  7232. }
  7233. @@ -274,7 +278,7 @@ func TestSignalIgnoreSIGTRAP(t *testing.T) {
  7234. func TestSignalDuringExec(t *testing.T) {
  7235. switch runtime.GOOS {
  7236. - case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd":
  7237. + case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd":
  7238. default:
  7239. t.Skipf("skipping test on %s", runtime.GOOS)
  7240. }
  7241. diff --git a/libgo/go/runtime/env_posix.go b/libgo/go/runtime/env_posix.go
  7242. index ddf3c02..0826e3d 100644
  7243. --- a/libgo/go/runtime/env_posix.go
  7244. +++ b/libgo/go/runtime/env_posix.go
  7245. @@ -1,8 +1,12 @@
  7246. // Copyright 2012 The Go Authors. All rights reserved.
  7247. +//
  7248. +// Modifications to support HyperbolaBSD:
  7249. +// Copyright (C) 2020-2024 Hyperbola Project
  7250. +//
  7251. // Use of this source code is governed by a BSD-style
  7252. // license that can be found in the LICENSE file.
  7253. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  7254. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  7255. package runtime
  7256. diff --git a/libgo/go/runtime/export_unix_test.go b/libgo/go/runtime/export_unix_test.go
  7257. index eecdfb7..15aea2a 100644
  7258. --- a/libgo/go/runtime/export_unix_test.go
  7259. +++ b/libgo/go/runtime/export_unix_test.go
  7260. @@ -1,8 +1,12 @@
  7261. // Copyright 2017 The Go Authors. All rights reserved.
  7262. +//
  7263. +// Modifications to support HyperbolaBSD:
  7264. +// Copyright (C) 2020-2024 Hyperbola Project
  7265. +//
  7266. // Use of this source code is governed by a BSD-style
  7267. // license that can be found in the LICENSE file.
  7268. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7269. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7270. package runtime
  7271. diff --git a/libgo/go/runtime/lock_sema.go b/libgo/go/runtime/lock_sema.go
  7272. index d000b11..ada601b 100644
  7273. --- a/libgo/go/runtime/lock_sema.go
  7274. +++ b/libgo/go/runtime/lock_sema.go
  7275. @@ -1,8 +1,12 @@
  7276. // Copyright 2011 The Go Authors. All rights reserved.
  7277. +//
  7278. +// Modifications to support HyperbolaBSD:
  7279. +// Copyright (C) 2020-2024 Hyperbola Project
  7280. +//
  7281. // Use of this source code is governed by a BSD-style
  7282. // license that can be found in the LICENSE file.
  7283. -// +build aix darwin nacl netbsd openbsd plan9 solaris windows
  7284. +// +build aix darwin nacl netbsd openbsd hyperbolabsd plan9 solaris windows
  7285. package runtime
  7286. diff --git a/libgo/go/runtime/netpoll.go b/libgo/go/runtime/netpoll.go
  7287. index e9bbfec..ae8a44b 100644
  7288. --- a/libgo/go/runtime/netpoll.go
  7289. +++ b/libgo/go/runtime/netpoll.go
  7290. @@ -1,8 +1,12 @@
  7291. // Copyright 2013 The Go Authors. All rights reserved.
  7292. +//
  7293. +// Modifications to support HyperbolaBSD:
  7294. +// Copyright (C) 2020-2024 Hyperbola Project
  7295. +//
  7296. // Use of this source code is governed by a BSD-style
  7297. // license that can be found in the LICENSE file.
  7298. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  7299. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  7300. package runtime
  7301. diff --git a/libgo/go/runtime/netpoll_kqueue.go b/libgo/go/runtime/netpoll_kqueue.go
  7302. index 1f68eff..c69accc 100644
  7303. --- a/libgo/go/runtime/netpoll_kqueue.go
  7304. +++ b/libgo/go/runtime/netpoll_kqueue.go
  7305. @@ -1,8 +1,12 @@
  7306. // Copyright 2013 The Go Authors. All rights reserved.
  7307. +//
  7308. +// Modifications to support HyperbolaBSD:
  7309. +// Copyright (C) 2020-2024 Hyperbola Project
  7310. +//
  7311. // Use of this source code is governed by a BSD-style
  7312. // license that can be found in the LICENSE file.
  7313. -// +build darwin dragonfly freebsd netbsd openbsd
  7314. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  7315. package runtime
  7316. diff --git b/libgo/go/runtime/os_hyperbolabsd.go b/libgo/go/runtime/os_hyperbolabsd.go
  7317. new file mode 100644
  7318. index 0000000..d7770dc
  7319. --- /dev/null
  7320. +++ b/libgo/go/runtime/os_hyperbolabsd.go
  7321. @@ -0,0 +1,80 @@
  7322. +// Copyright 2011 The Go Authors. All rights reserved.
  7323. +//
  7324. +// Modifications to support HyperbolaBSD:
  7325. +// Copyright (C) 2020-2024 Hyperbola Project
  7326. +//
  7327. +// Use of this source code is governed by a BSD-style
  7328. +// license that can be found in the LICENSE file.
  7329. +
  7330. +package runtime
  7331. +
  7332. +import (
  7333. + "runtime/internal/atomic"
  7334. + "unsafe"
  7335. +)
  7336. +
  7337. +type mOS struct {
  7338. + waitsemacount uint32
  7339. +}
  7340. +
  7341. +//go:noescape
  7342. +//extern thrsleep
  7343. +func thrsleep(ident uintptr, clock_id int32, tsp *timespec, lock uintptr, abort *uint32) int32
  7344. +
  7345. +//go:noescape
  7346. +//extern thrwakeup
  7347. +func thrwakeup(ident uintptr, n int32) int32
  7348. +
  7349. +//go:nosplit
  7350. +func semacreate(mp *m) {
  7351. +}
  7352. +
  7353. +//go:nosplit
  7354. +func semasleep(ns int64) int32 {
  7355. + _g_ := getg()
  7356. +
  7357. + // Compute sleep deadline.
  7358. + var tsp *timespec
  7359. + if ns >= 0 {
  7360. + var ts timespec
  7361. + var nsec int32
  7362. + ns += nanotime()
  7363. + ts.set_sec(int64(timediv(ns, 1000000000, &nsec)))
  7364. + ts.set_nsec(nsec)
  7365. + tsp = &ts
  7366. + }
  7367. +
  7368. + for {
  7369. + v := atomic.Load(&_g_.m.mos.waitsemacount)
  7370. + if v > 0 {
  7371. + if atomic.Cas(&_g_.m.mos.waitsemacount, v, v-1) {
  7372. + return 0 // semaphore acquired
  7373. + }
  7374. + continue
  7375. + }
  7376. +
  7377. + // Sleep until woken by semawakeup or timeout; or abort if waitsemacount != 0.
  7378. + //
  7379. + // From HyperbolaBSD's __thrsleep(2) manual:
  7380. + // "The abort argument, if not NULL, points to an int that will
  7381. + // be examined [...] immediately before blocking. If that int
  7382. + // is non-zero then __thrsleep() will immediately return EINTR
  7383. + // without blocking."
  7384. + ret := thrsleep(uintptr(unsafe.Pointer(&_g_.m.mos.waitsemacount)), _CLOCK_MONOTONIC, tsp, 0, &_g_.m.mos.waitsemacount)
  7385. + if ret == _EWOULDBLOCK {
  7386. + return -1
  7387. + }
  7388. + }
  7389. +}
  7390. +
  7391. +//go:nosplit
  7392. +func semawakeup(mp *m) {
  7393. + atomic.Xadd(&mp.mos.waitsemacount, 1)
  7394. + ret := thrwakeup(uintptr(unsafe.Pointer(&mp.mos.waitsemacount)), 1)
  7395. + if ret != 0 && ret != _ESRCH {
  7396. + // semawakeup can be called on signal stack.
  7397. + systemstack(func() {
  7398. + print("thrwakeup addr=", &mp.mos.waitsemacount, " sem=", mp.mos.waitsemacount, " ret=", ret, "\n")
  7399. + })
  7400. + }
  7401. +}
  7402. diff --git a/libgo/go/runtime/runtime_unix_test.go b/libgo/go/runtime/runtime_unix_test.go
  7403. index b0cbbbe..218125b 100644
  7404. --- a/libgo/go/runtime/runtime_unix_test.go
  7405. +++ b/libgo/go/runtime/runtime_unix_test.go
  7406. @@ -1,4 +1,8 @@
  7407. // Copyright 2013 The Go Authors. All rights reserved.
  7408. +//
  7409. +// Modifications to support HyperbolaBSD:
  7410. +// Copyright (C) 2020-2024 Hyperbola Project
  7411. +//
  7412. // Use of this source code is governed by a BSD-style
  7413. // license that can be found in the LICENSE file.
  7414. @@ -6,7 +10,7 @@
  7415. // We need a fast system call to provoke the race,
  7416. // and Close(-1) is nearly universally fast.
  7417. -// +build aix darwin dragonfly freebsd linux netbsd openbsd plan9
  7418. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd plan9
  7419. package runtime_test
  7420. diff --git a/libgo/go/runtime/signal_gccgo.go b/libgo/go/runtime/signal_gccgo.go
  7421. index 92143ea..1197598 100644
  7422. --- a/libgo/go/runtime/signal_gccgo.go
  7423. +++ b/libgo/go/runtime/signal_gccgo.go
  7424. @@ -1,8 +1,12 @@
  7425. // Copyright 2016 The Go Authors. All rights reserved.
  7426. +//
  7427. +// Modifications to support HyperbolaBSD:
  7428. +// Copyright (C) 2020-2024 Hyperbola Project
  7429. +//
  7430. // Use of this source code is governed by a BSD-style
  7431. // license that can be found in the LICENSE file.
  7432. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7433. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7434. package runtime
  7435. diff --git a/libgo/go/runtime/signal_sighandler.go b/libgo/go/runtime/signal_sighandler.go
  7436. index 698629d..c8cce0b 100644
  7437. --- a/libgo/go/runtime/signal_sighandler.go
  7438. +++ b/libgo/go/runtime/signal_sighandler.go
  7439. @@ -1,8 +1,12 @@
  7440. // Copyright 2013 The Go Authors. All rights reserved.
  7441. +//
  7442. +// Modifications to support HyperbolaBSD:
  7443. +// Copyright (C) 2020-2024 Hyperbola Project
  7444. +//
  7445. // Use of this source code is governed by a BSD-style
  7446. // license that can be found in the LICENSE file.
  7447. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  7448. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  7449. package runtime
  7450. diff --git a/libgo/go/runtime/signal_unix.go b/libgo/go/runtime/signal_unix.go
  7451. index a8f77fa..b63823b 100644
  7452. --- a/libgo/go/runtime/signal_unix.go
  7453. +++ b/libgo/go/runtime/signal_unix.go
  7454. @@ -1,8 +1,12 @@
  7455. // Copyright 2012 The Go Authors. All rights reserved.
  7456. +//
  7457. +// Modifications to support HyperbolaBSD:
  7458. +// Copyright (C) 2020-2024 Hyperbola Project
  7459. +//
  7460. // Use of this source code is governed by a BSD-style
  7461. // license that can be found in the LICENSE file.
  7462. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7463. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7464. package runtime
  7465. diff --git a/libgo/go/runtime/testdata/testprog/gc.go b/libgo/go/runtime/testdata/testprog/gc.go
  7466. index 5424517..f7f15c1 100644
  7467. --- a/libgo/go/runtime/testdata/testprog/gc.go
  7468. +++ b/libgo/go/runtime/testdata/testprog/gc.go
  7469. @@ -1,4 +1,8 @@
  7470. // Copyright 2015 The Go Authors. All rights reserved.
  7471. +//
  7472. +// Modifications to support HyperbolaBSD:
  7473. +// Copyright (C) 2024 Hyperbola Project
  7474. +//
  7475. // Use of this source code is governed by a BSD-style
  7476. // license that can be found in the LICENSE file.
  7477. @@ -102,10 +106,10 @@ func GCFairness2() {
  7478. // to let all goroutines run, but for now we cycle through
  7479. // them rapidly.
  7480. //
  7481. - // OpenBSD's scheduler makes every usleep() take at least
  7482. - // 20ms, so we need a long time to ensure all goroutines have
  7483. - // run. If they haven't run after 30ms, give it another 1000ms
  7484. - // and check again.
  7485. + // HyperbolaBSD and OpenBSD's scheduler makes every usleep()
  7486. + // take at least 20ms, so we need a long time to ensure all
  7487. + // goroutines have run. If they haven't run after 30ms, give it
  7488. + // another 1000ms and check again.
  7489. time.Sleep(30 * time.Millisecond)
  7490. var fail bool
  7491. for i := range count {
  7492. diff --git a/libgo/go/runtime/testdata/testprognet/signalexec.go b/libgo/go/runtime/testdata/testprognet/signalexec.go
  7493. index 4a988ef..e16f25f 100644
  7494. --- a/libgo/go/runtime/testdata/testprognet/signalexec.go
  7495. +++ b/libgo/go/runtime/testdata/testprognet/signalexec.go
  7496. @@ -1,8 +1,12 @@
  7497. // Copyright 2017 The Go Authors. All rights reserved.
  7498. +//
  7499. +// Modifications to support HyperbolaBSD:
  7500. +// Copyright (C) 2020-2024 Hyperbola Project
  7501. +//
  7502. // Use of this source code is governed by a BSD-style
  7503. // license that can be found in the LICENSE file.
  7504. -// +build darwin dragonfly freebsd linux netbsd openbsd
  7505. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd
  7506. // This is in testprognet instead of testprog because testprog
  7507. // must not import anything (like net, but also like os/signal)
  7508. diff --git a/libgo/go/runtime/trace/trace_test.go b/libgo/go/runtime/trace/trace_test.go
  7509. index 997d486..de842f4 100644
  7510. --- a/libgo/go/runtime/trace/trace_test.go
  7511. +++ b/libgo/go/runtime/trace/trace_test.go
  7512. @@ -1,4 +1,8 @@
  7513. // Copyright 2014 The Go Authors. All rights reserved.
  7514. +//
  7515. +// Modifications to support HyperbolaBSD:
  7516. +// Copyright (C) 2020-2024 Hyperbola Project
  7517. +//
  7518. // Use of this source code is governed by a BSD-style
  7519. // license that can be found in the LICENSE file.
  7520. @@ -223,6 +227,10 @@ func TestTraceStress(t *testing.T) {
  7521. // Reduce allocation to avoid running out of
  7522. // memory on the builder - see issue/12032.
  7523. n = 512
  7524. + } else if runtime.GOOS == "hyperbolabsd" && runtime.GOARCH == "arm" {
  7525. + // Reduce allocation to avoid running out of
  7526. + // memory on the builder - see issue/12032.
  7527. + n = 512
  7528. }
  7529. for i := 0; i < n; i++ {
  7530. _ = make([]byte, 1<<20)
  7531. @@ -361,6 +369,10 @@ func TestTraceStressStartStop(t *testing.T) {
  7532. // Reduce allocation to avoid running out of
  7533. // memory on the builder - see issue/12032.
  7534. n = 512
  7535. + } else if runtime.GOOS == "hyperbolabsd" && runtime.GOARCH == "arm" {
  7536. + // Reduce allocation to avoid running out of
  7537. + // memory on the builder - see issue/12032.
  7538. + n = 512
  7539. }
  7540. for i := 0; i < n; i++ {
  7541. _ = make([]byte, 1<<20)
  7542. diff --git a/libgo/go/syscall/bpf_bsd.go b/libgo/go/syscall/bpf_bsd.go
  7543. index 8b58755..6889ddc 100644
  7544. --- a/libgo/go/syscall/bpf_bsd.go
  7545. +++ b/libgo/go/syscall/bpf_bsd.go
  7546. @@ -1,8 +1,12 @@
  7547. // Copyright 2011 The Go Authors. All rights reserved.
  7548. +//
  7549. +// Modifications to support HyperbolaBSD:
  7550. +// Copyright (C) 2020-2024 Hyperbola Project
  7551. +//
  7552. // Use of this source code is governed by a BSD-style
  7553. // license that can be found in the LICENSE file.
  7554. -// +build darwin dragonfly freebsd netbsd openbsd
  7555. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  7556. // Berkeley packet filter for BSD variants
  7557. diff --git a/libgo/go/syscall/dirent.go b/libgo/go/syscall/dirent.go
  7558. index a09bf05..4e836ee 100644
  7559. --- a/libgo/go/syscall/dirent.go
  7560. +++ b/libgo/go/syscall/dirent.go
  7561. @@ -1,8 +1,12 @@
  7562. // Copyright 2009 The Go Authors. All rights reserved.
  7563. +//
  7564. +// Modifications to support HyperbolaBSD:
  7565. +// Copyright (C) 2020-2024 Hyperbola Project
  7566. +//
  7567. // Use of this source code is governed by a BSD-style
  7568. // license that can be found in the LICENSE file.
  7569. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  7570. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  7571. package syscall
  7572. diff --git a/libgo/go/syscall/env_unix.go b/libgo/go/syscall/env_unix.go
  7573. index eb93e2e..7783585 100644
  7574. --- a/libgo/go/syscall/env_unix.go
  7575. +++ b/libgo/go/syscall/env_unix.go
  7576. @@ -1,8 +1,12 @@
  7577. // Copyright 2010 The Go Authors. All rights reserved.
  7578. +//
  7579. +// Modifications to support HyperbolaBSD:
  7580. +// Copyright (C) 2020-2024 Hyperbola Project
  7581. +//
  7582. // Use of this source code is governed by a BSD-style
  7583. // license that can be found in the LICENSE file.
  7584. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  7585. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  7586. // Unix environment variables.
  7587. diff --git a/libgo/go/syscall/exec_bsd.go b/libgo/go/syscall/exec_bsd.go
  7588. index 9115cf0..ec6e71a 100644
  7589. --- a/libgo/go/syscall/exec_bsd.go
  7590. +++ b/libgo/go/syscall/exec_bsd.go
  7591. @@ -1,8 +1,12 @@
  7592. // Copyright 2011 The Go Authors. All rights reserved.
  7593. +//
  7594. +// Modifications to support HyperbolaBSD:
  7595. +// Copyright (C) 2020-2024 Hyperbola Project
  7596. +//
  7597. // Use of this source code is governed by a BSD-style
  7598. // license that can be found in the LICENSE file.
  7599. -// +build aix darwin dragonfly freebsd netbsd openbsd solaris
  7600. +// +build aix darwin dragonfly freebsd netbsd openbsd hyperbolabsd solaris
  7601. package syscall
  7602. diff --git a/libgo/go/syscall/exec_unix.go b/libgo/go/syscall/exec_unix.go
  7603. index 8d83e91..2598021 100644
  7604. --- a/libgo/go/syscall/exec_unix.go
  7605. +++ b/libgo/go/syscall/exec_unix.go
  7606. @@ -1,8 +1,12 @@
  7607. // Copyright 2009 The Go Authors. All rights reserved.
  7608. +//
  7609. +// Modifications to support HyperbolaBSD:
  7610. +// Copyright (C) 2020-2024 Hyperbola Project
  7611. +//
  7612. // Use of this source code is governed by a BSD-style
  7613. // license that can be found in the LICENSE file.
  7614. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7615. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7616. // Fork, exec, wait, etc.
  7617. diff --git a/libgo/go/syscall/exec_unix_test.go b/libgo/go/syscall/exec_unix_test.go
  7618. index 58708da..5f77986 100644
  7619. --- a/libgo/go/syscall/exec_unix_test.go
  7620. +++ b/libgo/go/syscall/exec_unix_test.go
  7621. @@ -1,8 +1,12 @@
  7622. // Copyright 2015 The Go Authors. All rights reserved.
  7623. +//
  7624. +// Modifications to support HyperbolaBSD:
  7625. +// Copyright (C) 2020-2024 Hyperbola Project
  7626. +//
  7627. // Use of this source code is governed by a BSD-style
  7628. // license that can be found in the LICENSE file.
  7629. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7630. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7631. package syscall_test
  7632. diff --git a/libgo/go/syscall/export_unix_test.go b/libgo/go/syscall/export_unix_test.go
  7633. index 120500c..e0dc72f 100644
  7634. --- a/libgo/go/syscall/export_unix_test.go
  7635. +++ b/libgo/go/syscall/export_unix_test.go
  7636. @@ -1,8 +1,12 @@
  7637. // Copyright 2015 The Go Authors. All rights reserved.
  7638. +//
  7639. +// Modifications to support HyperbolaBSD:
  7640. +// Copyright (C) 2020-2024 Hyperbola Project
  7641. +//
  7642. // Use of this source code is governed by a BSD-style
  7643. // license that can be found in the LICENSE file.
  7644. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7645. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7646. package syscall
  7647. diff --git a/libgo/go/syscall/forkpipe_bsd.go b/libgo/go/syscall/forkpipe_bsd.go
  7648. index d479284..65a8f84 100644
  7649. --- a/libgo/go/syscall/forkpipe_bsd.go
  7650. +++ b/libgo/go/syscall/forkpipe_bsd.go
  7651. @@ -1,8 +1,12 @@
  7652. // Copyright 2011 The Go Authors. All rights reserved.
  7653. +//
  7654. +// Modifications to support HyperbolaBSD:
  7655. +// Copyright (C) 2020-2024 Hyperbola Project
  7656. +//
  7657. // Use of this source code is governed by a BSD-style
  7658. // license that can be found in the LICENSE file.
  7659. -// +build aix darwin dragonfly netbsd openbsd solaris
  7660. +// +build aix darwin dragonfly netbsd openbsd hyperbola solaris
  7661. package syscall
  7662. diff --git a/libgo/go/syscall/libcall_bsd.go b/libgo/go/syscall/libcall_bsd.go
  7663. index 9a4b2d6..bd337bd 100644
  7664. --- a/libgo/go/syscall/libcall_bsd.go
  7665. +++ b/libgo/go/syscall/libcall_bsd.go
  7666. @@ -1,8 +1,12 @@
  7667. // Copyright 2015 The Go Authors. All rights reserved.
  7668. +//
  7669. +// Modifications to support HyperbolaBSD:
  7670. +// Copyright (C) 2020-2024 Hyperbola Project
  7671. +//
  7672. // Use of this source code is governed by a BSD-style
  7673. // license that can be found in the LICENSE file.
  7674. -// +build darwin dragonfly freebsd netbsd openbsd solaris
  7675. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd solaris
  7676. // BSD library calls.
  7677. diff --git a/libgo/go/syscall/libcall_posix_utimesnano.go b/libgo/go/syscall/libcall_posix_utimesnano.go
  7678. index 372b0d7..62696e8 100644
  7679. --- a/libgo/go/syscall/libcall_posix_utimesnano.go
  7680. +++ b/libgo/go/syscall/libcall_posix_utimesnano.go
  7681. @@ -1,8 +1,12 @@
  7682. // Copyright 2012 The Go Authors. All rights reserved.
  7683. +//
  7684. +// Modifications to support HyperbolaBSD:
  7685. +// Copyright (C) 2020-2024 Hyperbola Project
  7686. +//
  7687. // Use of this source code is governed by a BSD-style
  7688. // license that can be found in the LICENSE file.
  7689. -// +build aix darwin dragonfly freebsd openbsd netbsd solaris
  7690. +// +build aix darwin dragonfly freebsd hyperbolabsd openbsd netbsd solaris
  7691. // General POSIX version of UtimesNano.
  7692. diff --git a/libgo/go/syscall/mmap_unix_test.go b/libgo/go/syscall/mmap_unix_test.go
  7693. index d0b3644..92140c9 100644
  7694. --- a/libgo/go/syscall/mmap_unix_test.go
  7695. +++ b/libgo/go/syscall/mmap_unix_test.go
  7696. @@ -1,8 +1,12 @@
  7697. // Copyright 2014 The Go Authors. All rights reserved.
  7698. +//
  7699. +// Modifications to support HyperbolaBSD:
  7700. +// Copyright (C) 2020-2024 Hyperbola Project
  7701. +//
  7702. // Use of this source code is governed by a BSD-style
  7703. // license that can be found in the LICENSE file.
  7704. -// +build aix darwin dragonfly freebsd linux netbsd openbsd
  7705. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd
  7706. package syscall_test
  7707. diff --git a/libgo/go/syscall/route_bsd.go b/libgo/go/syscall/route_bsd.go
  7708. index b364eea..e4b21a0 100644
  7709. --- a/libgo/go/syscall/route_bsd.go
  7710. +++ b/libgo/go/syscall/route_bsd.go
  7711. @@ -1,8 +1,12 @@
  7712. // Copyright 2011 The Go Authors. All rights reserved.
  7713. +//
  7714. +// Modifications to support HyperbolaBSD:
  7715. +// Copyright (C) 2020-2024 Hyperbola Project
  7716. +//
  7717. // Use of this source code is governed by a BSD-style
  7718. // license that can be found in the LICENSE file.
  7719. -// +build darwin dragonfly freebsd netbsd openbsd
  7720. +// +build darwin dragonfly freebsd netbsd openbsd hyperbolabsd
  7721. package syscall
  7722. diff --git b/libgo/go/syscall/route_hyperbolabsd.go b/libgo/go/syscall/route_hyperbolabsd.go
  7723. new file mode 100644
  7724. index 0000000..d254531
  7725. --- /dev/null
  7726. +++ b/libgo/go/syscall/route_hyperbolabsd.go
  7727. @@ -0,0 +1,41 @@
  7728. +// Copyright 2011 The Go Authors. All rights reserved.
  7729. +//
  7730. +// Modifications to support HyperbolaBSD:
  7731. +// Copyright (C) 2020-2024 Hyperbola Project
  7732. +//
  7733. +// Use of this source code is governed by a BSD-style
  7734. +// license that can be found in the LICENSE file.
  7735. +
  7736. +package syscall
  7737. +
  7738. +import "unsafe"
  7739. +
  7740. +func (any *anyMessage) toRoutingMessage(b []byte) RoutingMessage {
  7741. + switch any.Type {
  7742. + case RTM_ADD, RTM_DELETE, RTM_CHANGE, RTM_GET, RTM_LOSING, RTM_REDIRECT, RTM_MISS, RTM_LOCK, RTM_RESOLVE:
  7743. + p := (*RouteMessage)(unsafe.Pointer(any))
  7744. + // We don't support sockaddr_rtlabel for now.
  7745. + p.Header.Addrs &= RTA_DST | RTA_GATEWAY | RTA_NETMASK | RTA_GENMASK | RTA_IFA | RTA_IFP | RTA_BRD | RTA_AUTHOR | RTA_SRC | RTA_SRCMASK
  7746. + return &RouteMessage{Header: p.Header, Data: b[p.Header.Hdrlen:any.Msglen]}
  7747. + case RTM_IFINFO:
  7748. + p := (*InterfaceMessage)(unsafe.Pointer(any))
  7749. + return &InterfaceMessage{Header: p.Header, Data: b[p.Header.Hdrlen:any.Msglen]}
  7750. + case RTM_IFANNOUNCE:
  7751. + p := (*InterfaceAnnounceMessage)(unsafe.Pointer(any))
  7752. + return &InterfaceAnnounceMessage{Header: p.Header}
  7753. + case RTM_NEWADDR, RTM_DELADDR:
  7754. + p := (*InterfaceAddrMessage)(unsafe.Pointer(any))
  7755. + return &InterfaceAddrMessage{Header: p.Header, Data: b[p.Header.Hdrlen:any.Msglen]}
  7756. + }
  7757. + return nil
  7758. +}
  7759. +
  7760. +// InterfaceAnnounceMessage represents a routing message containing
  7761. +// network interface arrival and departure information.
  7762. +//
  7763. +// Deprecated: Use golang.org/x/net/route instead.
  7764. +type InterfaceAnnounceMessage struct {
  7765. + Header IfAnnounceMsghdr
  7766. +}
  7767. +
  7768. +func (m *InterfaceAnnounceMessage) sockaddr() ([]Sockaddr, error) { return nil, nil }
  7769. diff --git a/libgo/go/syscall/sockcmsg_unix.go b/libgo/go/syscall/sockcmsg_unix.go
  7770. index c01602f..a58304c 100644
  7771. --- a/libgo/go/syscall/sockcmsg_unix.go
  7772. +++ b/libgo/go/syscall/sockcmsg_unix.go
  7773. @@ -1,8 +1,12 @@
  7774. // Copyright 2011 The Go Authors. All rights reserved.
  7775. +//
  7776. +// Modifications to support HyperbolaBSD:
  7777. +// Copyright (C) 2020-2024 Hyperbola Project
  7778. +//
  7779. // Use of this source code is governed by a BSD-style
  7780. // license that can be found in the LICENSE file.
  7781. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7782. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7783. // Socket control messages
  7784. diff --git a/libgo/go/syscall/socket_bsd.go b/libgo/go/syscall/socket_bsd.go
  7785. index cf3fc4f..d6d98d6 100644
  7786. --- a/libgo/go/syscall/socket_bsd.go
  7787. +++ b/libgo/go/syscall/socket_bsd.go
  7788. @@ -1,10 +1,14 @@
  7789. // socket_bsd.go -- Socket handling specific to *BSD based systems.
  7790. // Copyright 2010 The Go Authors. All rights reserved.
  7791. +//
  7792. +// Modifications to support HyperbolaBSD:
  7793. +// Copyright (C) 2020-2024 Hyperbola Project
  7794. +//
  7795. // Use of this source code is governed by a BSD-style
  7796. // license that can be found in the LICENSE file.
  7797. -// +build darwin dragonfly freebsd openbsd netbsd
  7798. +// +build darwin dragonfly freebsd hyperbolabsd openbsd netbsd
  7799. package syscall
  7800. diff --git b/libgo/go/syscall/syscall_hyperbolabsd.go b/libgo/go/syscall/syscall_hyperbolabsd.go
  7801. new file mode 100644
  7802. index 0000000..7e8dadf
  7803. --- /dev/null
  7804. +++ b/libgo/go/syscall/syscall_hyperbolabsd.go
  7805. @@ -0,0 +1,23 @@
  7806. +// Copyright 2009,2010 The Go Authors. All rights reserved.
  7807. +//
  7808. +// Modifications to support HyperbolaBSD:
  7809. +// Copyright (C) 2020-2024 Hyperbola Project
  7810. +//
  7811. +// Use of this source code is governed by a BSD-style
  7812. +// license that can be found in the LICENSE file.
  7813. +
  7814. +package syscall
  7815. +
  7816. +import "unsafe"
  7817. +
  7818. +func direntIno(buf []byte) (uint64, bool) {
  7819. + return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
  7820. +}
  7821. +
  7822. +func direntReclen(buf []byte) (uint64, bool) {
  7823. + return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
  7824. +}
  7825. +
  7826. +func direntNamlen(buf []byte) (uint64, bool) {
  7827. + return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
  7828. +}
  7829. diff --git a/libgo/go/syscall/syscall_unix.go b/libgo/go/syscall/syscall_unix.go
  7830. index 61aa1c4..771aed2 100644
  7831. --- a/libgo/go/syscall/syscall_unix.go
  7832. +++ b/libgo/go/syscall/syscall_unix.go
  7833. @@ -1,8 +1,12 @@
  7834. // Copyright 2009 The Go Authors. All rights reserved.
  7835. +//
  7836. +// Modifications to support HyperbolaBSD:
  7837. +// Copyright (C) 2020-2024 Hyperbola Project
  7838. +//
  7839. // Use of this source code is governed by a BSD-style
  7840. // license that can be found in the LICENSE file.
  7841. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7842. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7843. package syscall
  7844. diff --git a/libgo/go/syscall/syscall_unix_test.go b/libgo/go/syscall/syscall_unix_test.go
  7845. index 637aece..07fcb73 100644
  7846. --- a/libgo/go/syscall/syscall_unix_test.go
  7847. +++ b/libgo/go/syscall/syscall_unix_test.go
  7848. @@ -1,8 +1,12 @@
  7849. // Copyright 2013 The Go Authors. All rights reserved.
  7850. +//
  7851. +// Modifications to support HyperbolaBSD:
  7852. +// Copyright (C) 2020-2024 Hyperbola Project
  7853. +//
  7854. // Use of this source code is governed by a BSD-style
  7855. // license that can be found in the LICENSE file.
  7856. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  7857. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7858. package syscall_test
  7859. diff --git a/libgo/go/syscall/timestruct.go b/libgo/go/syscall/timestruct.go
  7860. index 6ece338..1af1cf9 100644
  7861. --- a/libgo/go/syscall/timestruct.go
  7862. +++ b/libgo/go/syscall/timestruct.go
  7863. @@ -1,8 +1,12 @@
  7864. // Copyright 2016 The Go Authors. All rights reserved.
  7865. +//
  7866. +// Modifications to support HyperbolaBSD:
  7867. +// Copyright (C) 2020-2024 Hyperbola Project
  7868. +//
  7869. // Use of this source code is governed by a BSD-style
  7870. // license that can be found in the LICENSE file.
  7871. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  7872. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  7873. package syscall
  7874. diff --git a/libgo/go/time/sys_unix.go b/libgo/go/time/sys_unix.go
  7875. index 3827965..c836c23 100644
  7876. --- a/libgo/go/time/sys_unix.go
  7877. +++ b/libgo/go/time/sys_unix.go
  7878. @@ -1,8 +1,12 @@
  7879. // Copyright 2011 The Go Authors. All rights reserved.
  7880. +//
  7881. +// Modifications to support HyperbolaBSD:
  7882. +// Copyright (C) 2020-2024 Hyperbola Project
  7883. +//
  7884. // Use of this source code is governed by a BSD-style
  7885. // license that can be found in the LICENSE file.
  7886. -// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  7887. +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris
  7888. package time
  7889. diff --git a/libgo/go/time/zoneinfo_unix.go b/libgo/go/time/zoneinfo_unix.go
  7890. index 32dc7d5..840a95f 100644
  7891. --- a/libgo/go/time/zoneinfo_unix.go
  7892. +++ b/libgo/go/time/zoneinfo_unix.go
  7893. @@ -1,8 +1,12 @@
  7894. // Copyright 2009 The Go Authors. All rights reserved.
  7895. +//
  7896. +// Modifications to support HyperbolaBSD:
  7897. +// Copyright (C) 2020-2024 Hyperbola Project
  7898. +//
  7899. // Use of this source code is governed by a BSD-style
  7900. // license that can be found in the LICENSE file.
  7901. -// +build aix darwin,386 darwin,amd64 dragonfly freebsd linux,!android nacl netbsd openbsd solaris
  7902. +// +build aix darwin,386 darwin,amd64 dragonfly freebsd linux,!android nacl netbsd openbsd hyperbolabsd solaris
  7903. // Parse "zoneinfo" time zone file.
  7904. // This is a fairly standard file format used on OS X, Linux, BSD, Sun, and others.
  7905. diff --git a/libgo/match.sh b/libgo/match.sh
  7906. index 9247ec6..7d68729 100755
  7907. --- a/libgo/match.sh
  7908. +++ b/libgo/match.sh
  7909. @@ -1,6 +1,10 @@
  7910. #!/bin/sh
  7911. # Copyright 2016 The Go Authors. All rights reserved.
  7912. +#
  7913. +# Modifications to support HyperbolaBSD:
  7914. +# Copyright (C) 2020-2024 Hyperbola Project
  7915. +#
  7916. # Use of this source code is governed by a BSD-style
  7917. # license that can be found in the LICENSE file.
  7918. @@ -113,7 +117,7 @@ for f in $gofiles; do
  7919. "") ;;
  7920. $goarch) ;;
  7921. $goos) ;;
  7922. - aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
  7923. + aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | hyperbolabsd | plan9 | solaris | windows)
  7924. tag1=nonmatchingtag
  7925. ;;
  7926. 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64)
  7927. @@ -125,7 +129,7 @@ for f in $gofiles; do
  7928. "") ;;
  7929. $goarch) ;;
  7930. $goos) ;;
  7931. - aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
  7932. + aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | hyperbolabsd | plan9 | solaris | windows)
  7933. tag2=nonmatchingtag
  7934. ;;
  7935. 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64)
  7936. diff --git a/libgo/misc/cgo/test/basic.go b/libgo/misc/cgo/test/basic.go
  7937. index 3ceb4ce..879be07 100644
  7938. --- a/libgo/misc/cgo/test/basic.go
  7939. +++ b/libgo/misc/cgo/test/basic.go
  7940. @@ -1,4 +1,8 @@
  7941. // Copyright 2010 The Go Authors. All rights reserved.
  7942. +//
  7943. +// Modifications to support HyperbolaBSD:
  7944. +// Copyright (C) 2020-2024 Hyperbola Project
  7945. +//
  7946. // Use of this source code is governed by a BSD-style
  7947. // license that can be found in the LICENSE file.
  7948. @@ -125,6 +129,11 @@ func testMultipleAssign(t *testing.T) {
  7949. if (n != 0 && n != 239089) || m != 234 {
  7950. t.Fatal("Strtol x2: ", n, m)
  7951. }
  7952. + } else if runtime.GOOS == "hyperbolabsd" {
  7953. + // Bug in HyperbolaBSD strtol(3) - base > 36 succeeds.
  7954. + if (n != 0 && n != 239089) || m != 234 {
  7955. + t.Fatal("Strtol x2: ", n, m)
  7956. + }
  7957. } else if n != 0 || m != 234 {
  7958. t.Fatal("Strtol x2: ", n, m)
  7959. }
  7960. diff --git a/libgo/misc/cgo/test/cgo_thread_lock.go b/libgo/misc/cgo/test/cgo_thread_lock.go
  7961. index b105068..a84b49e 100644
  7962. --- a/libgo/misc/cgo/test/cgo_thread_lock.go
  7963. +++ b/libgo/misc/cgo/test/cgo_thread_lock.go
  7964. @@ -1,8 +1,12 @@
  7965. // Copyright 2016 The Go Authors. All rights reserved.
  7966. +//
  7967. +// Modifications to support HyperbolaBSD:
  7968. +// Copyright (C) 2020-2024 Hyperbola Project
  7969. +//
  7970. // Use of this source code is governed by a BSD-style
  7971. // license that can be found in the LICENSE file.
  7972. -// +build linux,freebsd,openbsd
  7973. +// +build linux,freebsd,openbsd,hyperbolabsd
  7974. package cgotest
  7975. diff --git a/libgo/misc/cgo/test/cthread_unix.c b/libgo/misc/cgo/test/cthread_unix.c
  7976. index 247d636..1c0877c 100644
  7977. --- a/libgo/misc/cgo/test/cthread_unix.c
  7978. +++ b/libgo/misc/cgo/test/cthread_unix.c
  7979. @@ -1,8 +1,12 @@
  7980. // Copyright 2013 The Go Authors. All rights reserved.
  7981. +//
  7982. +// Modifications to support HyperbolaBSD:
  7983. +// Copyright (C) 2020-2024 Hyperbola Project
  7984. +//
  7985. // Use of this source code is governed by a BSD-style
  7986. // license that can be found in the LICENSE file.
  7987. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  7988. +// +build aix darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  7989. #include <pthread.h>
  7990. #include "_cgo_export.h"
  7991. diff --git a/libgo/misc/cgo/test/issue18146.go b/libgo/misc/cgo/test/issue18146.go
  7992. index a58aa1b..2d77c8e 100644
  7993. --- a/libgo/misc/cgo/test/issue18146.go
  7994. +++ b/libgo/misc/cgo/test/issue18146.go
  7995. @@ -1,4 +1,8 @@
  7996. // Copyright 2016 The Go Authors. All rights reserved.
  7997. +//
  7998. +// Modifications to support HyperbolaBSD:
  7999. +// Copyright (C) 2020-2024 Hyperbola Project
  8000. +//
  8001. // Use of this source code is governed by a BSD-style
  8002. // license that can be found in the LICENSE file.
  8003. @@ -48,7 +52,7 @@ func test18146(t *testing.T) {
  8004. setNproc = false
  8005. case "linux":
  8006. nproc = 6
  8007. - case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd":
  8008. + case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "hyperbolabsd":
  8009. nproc = 7
  8010. case "aix":
  8011. nproc = 9
  8012. @@ -97,7 +101,7 @@ func test18146(t *testing.T) {
  8013. if err := cmd.Start(); err != nil {
  8014. // We are starting so many processes that on
  8015. // some systems (problem seen on Darwin,
  8016. - // Dragonfly, OpenBSD) the fork call will fail
  8017. + // Dragonfly, OpenBSD, HyperbolaBSD) the fork call will fail
  8018. // with EAGAIN.
  8019. if pe, ok := err.(*os.PathError); ok {
  8020. err = pe.Err
  8021. diff --git a/libgo/misc/cgo/testcarchive/carchive_test.go b/libgo/misc/cgo/testcarchive/carchive_test.go
  8022. index 4a8cc0f..6028b6c 100644
  8023. --- a/libgo/misc/cgo/testcarchive/carchive_test.go
  8024. +++ b/libgo/misc/cgo/testcarchive/carchive_test.go
  8025. @@ -1,4 +1,8 @@
  8026. // Copyright 2016 The Go Authors. All rights reserved.
  8027. +//
  8028. +// Modifications to support HyperbolaBSD:
  8029. +// Copyright (C) 2020-2024 Hyperbola Project
  8030. +//
  8031. // Use of this source code is governed by a BSD-style
  8032. // license that can be found in the LICENSE file.
  8033. @@ -91,7 +95,7 @@ func init() {
  8034. if GOARCH == "arm" || GOARCH == "arm64" {
  8035. libgodir += "_shared"
  8036. }
  8037. - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris":
  8038. + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd", "solaris":
  8039. libgodir += "_shared"
  8040. }
  8041. }
  8042. diff --git a/libgo/misc/cgo/testcshared/cshared_test.go b/libgo/misc/cgo/testcshared/cshared_test.go
  8043. index e43422d..c54e5e9 100644
  8044. --- a/libgo/misc/cgo/testcshared/cshared_test.go
  8045. +++ b/libgo/misc/cgo/testcshared/cshared_test.go
  8046. @@ -1,4 +1,8 @@
  8047. // Copyright 2017 The Go Authors. All rights reserved.
  8048. +//
  8049. +// Modifications to support HyperbolaBSD:
  8050. +// Copyright (C) 2020-2024 Hyperbola Project
  8051. +//
  8052. // Use of this source code is governed by a BSD-style
  8053. // license that can be found in the LICENSE file.
  8054. @@ -115,7 +119,7 @@ func TestMain(m *testing.M) {
  8055. if GOARCH == "arm" || GOARCH == "arm64" {
  8056. libgodir += "_shared"
  8057. }
  8058. - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris":
  8059. + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "hyperbolabsd", "solaris":
  8060. libgodir += "_shared"
  8061. }
  8062. cc = append(cc, "-I", filepath.Join("pkg", libgodir))
  8063. diff --git a/libgo/misc/cgo/testcshared/src/libgo2/dup2.go b/libgo/misc/cgo/testcshared/src/libgo2/dup2.go
  8064. index d343aa5..6850d9f 100644
  8065. --- a/libgo/misc/cgo/testcshared/src/libgo2/dup2.go
  8066. +++ b/libgo/misc/cgo/testcshared/src/libgo2/dup2.go
  8067. @@ -1,8 +1,12 @@
  8068. // Copyright 2015 The Go Authors. All rights reserved.
  8069. +//
  8070. +// Modifications to support HyperbolaBSD:
  8071. +// Copyright (C) 2020-2024 Hyperbola Project
  8072. +//
  8073. // Use of this source code is governed by a BSD-style
  8074. // license that can be found in the LICENSE file.
  8075. -// +build darwin dragonfly freebsd linux,!arm64,!riscv64 netbsd openbsd
  8076. +// +build darwin dragonfly freebsd linux,!arm64,!riscv64 netbsd openbsd hyperbolabsd
  8077. package main
  8078. diff --git a/libgo/misc/cgo/testcshared/src/libgo2/libgo2.go b/libgo/misc/cgo/testcshared/src/libgo2/libgo2.go
  8079. index e57c93b..2b989b5 100644
  8080. --- a/libgo/misc/cgo/testcshared/src/libgo2/libgo2.go
  8081. +++ b/libgo/misc/cgo/testcshared/src/libgo2/libgo2.go
  8082. @@ -1,8 +1,12 @@
  8083. // Copyright 2015 The Go Authors. All rights reserved.
  8084. +//
  8085. +// Modifications to support HyperbolaBSD:
  8086. +// Copyright (C) 2020-2024 Hyperbola Project
  8087. +//
  8088. // Use of this source code is governed by a BSD-style
  8089. // license that can be found in the LICENSE file.
  8090. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris
  8091. +// +build darwin dragonfly freebsd linux netbsd openbsd hyperbolabsd solaris
  8092. package main
  8093. diff --git a/libgo/misc/cgo/testso/cgoso.go b/libgo/misc/cgo/testso/cgoso.go
  8094. index 29814fa..23e9a97 100644
  8095. --- a/libgo/misc/cgo/testso/cgoso.go
  8096. +++ b/libgo/misc/cgo/testso/cgoso.go
  8097. @@ -1,4 +1,8 @@
  8098. // Copyright 2011 The Go Authors. All rights reserved.
  8099. +//
  8100. +// Modifications to support HyperbolaBSD:
  8101. +// Copyright (C) 2020-2024 Hyperbola Project
  8102. +//
  8103. // Use of this source code is governed by a BSD-style
  8104. // license that can be found in the LICENSE file.
  8105. @@ -10,6 +14,7 @@ package cgosotest
  8106. #cgo linux LDFLAGS: -L. -lcgosotest
  8107. #cgo dragonfly LDFLAGS: -L. -l cgosotest
  8108. #cgo freebsd LDFLAGS: -L. -l cgosotest
  8109. +#cgo hyperbolabsd LDFLAGS: -L. -l cgosotest
  8110. #cgo openbsd LDFLAGS: -L. -l cgosotest
  8111. #cgo solaris LDFLAGS: -L. -lcgosotest
  8112. #cgo netbsd LDFLAGS: -L. libcgosotest.so
  8113. diff --git a/libgo/misc/cgo/testso/cgoso_c.c b/libgo/misc/cgo/testso/cgoso_c.c
  8114. index 7a38022..3f8de46 100644
  8115. --- a/libgo/misc/cgo/testso/cgoso_c.c
  8116. +++ b/libgo/misc/cgo/testso/cgoso_c.c
  8117. @@ -1,4 +1,8 @@
  8118. // Copyright 2011 The Go Authors. All rights reserved.
  8119. +//
  8120. +// Modifications to support HyperbolaBSD:
  8121. +// Copyright (C) 2024 Hyperbola Project
  8122. +//
  8123. // Use of this source code is governed by a BSD-style
  8124. // license that can be found in the LICENSE file.
  8125. @@ -19,8 +23,8 @@ extern void goCallback(void);
  8126. void setCallback(void *f) { (void)f; }
  8127. #endif
  8128. -// OpenBSD and older Darwin lack TLS support
  8129. -#if !defined(__OpenBSD__) && !defined(__APPLE__)
  8130. +// OpenBSD, HyperbolaBSD and older Darwin lack TLS support
  8131. +#if !defined(__OpenBSD__) && !defined(__HyperbolaBSD__) && !defined(__APPLE__)
  8132. __thread int tlsvar = 12345;
  8133. #endif
  8134. diff --git a/libgo/misc/cgo/testsovar/cgoso.go b/libgo/misc/cgo/testsovar/cgoso.go
  8135. index 88d44c2..01152a3 100644
  8136. --- a/libgo/misc/cgo/testsovar/cgoso.go
  8137. +++ b/libgo/misc/cgo/testsovar/cgoso.go
  8138. @@ -1,4 +1,8 @@
  8139. // Copyright 2015 The Go Authors. All rights reserved.
  8140. +//
  8141. +// Modifications to support HyperbolaBSD:
  8142. +// Copyright (C) 2020-2024 Hyperbola Project
  8143. +//
  8144. // Use of this source code is governed by a BSD-style
  8145. // license that can be found in the LICENSE file.
  8146. @@ -14,6 +18,7 @@ package cgosotest
  8147. #cgo linux LDFLAGS: -L. -lcgosotest
  8148. #cgo dragonfly LDFLAGS: -L. -l cgosotest
  8149. #cgo freebsd LDFLAGS: -L. -l cgosotest
  8150. +#cgo hyperbolabsd LDFLAGS: -L. -l cgosotest
  8151. #cgo openbsd LDFLAGS: -L. -l cgosotest
  8152. #cgo solaris LDFLAGS: -L. -lcgosotest
  8153. #cgo netbsd LDFLAGS: -L. libcgosotest.so
  8154. diff --git a/libgo/runtime/env_posix.c b/libgo/runtime/env_posix.c
  8155. index 8cffa73..f958b4f 100644
  8156. --- a/libgo/runtime/env_posix.c
  8157. +++ b/libgo/runtime/env_posix.c
  8158. @@ -1,8 +1,12 @@
  8159. // Copyright 2012 The Go Authors. All rights reserved.
  8160. +//
  8161. +// Modifications to support HyperbolaBSD:
  8162. +// Copyright (C) 2020-2024 Hyperbola Project
  8163. +//
  8164. // Use of this source code is governed by a BSD-style
  8165. // license that can be found in the LICENSE file.
  8166. -// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
  8167. +// +build darwin dragonfly freebsd linux nacl netbsd openbsd hyperbolabsd solaris windows
  8168. #include "runtime.h"
  8169. #include "array.h"
  8170. diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
  8171. index 434c26d..8be4ef7 100755
  8172. --- a/libgo/testsuite/gotest
  8173. +++ b/libgo/testsuite/gotest
  8174. @@ -1,5 +1,9 @@
  8175. #!/bin/sh
  8176. # Copyright 2009 The Go Authors. All rights reserved.
  8177. +#
  8178. +# Modifications to support HyperbolaBSD:
  8179. +# Copyright (C) 2020-2024 Hyperbola Project
  8180. +#
  8181. # Use of this source code is governed by a BSD-style
  8182. # license that can be found in the LICENSE file.
  8183. @@ -311,7 +315,7 @@ x)
  8184. "") ;;
  8185. $goarch) ;;
  8186. $goos) ;;
  8187. - aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
  8188. + aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | hyperbolabsd | plan9 | solaris | windows)
  8189. tag1=nonmatchingtag
  8190. ;;
  8191. 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64)
  8192. @@ -323,7 +327,7 @@ x)
  8193. "") ;;
  8194. $goarch) ;;
  8195. $goos) ;;
  8196. - aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
  8197. + aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | hyperbolabsd | plan9 | solaris | windows)
  8198. tag2=nonmatchingtag
  8199. ;;
  8200. 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64)
  8201. diff --git a/libgomp/configure b/libgomp/configure
  8202. index b731d04..c08a29c 100755
  8203. --- a/libgomp/configure
  8204. +++ b/libgomp/configure
  8205. @@ -6,6 +6,9 @@
  8206. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8207. # Foundation, Inc.
  8208. #
  8209. +# Modifications to support HyperbolaBSD:
  8210. +# Copyright (C) 2020-2024 Hyperbola Project
  8211. +#
  8212. # This configure script is free software; the Free Software Foundation
  8213. # gives unlimited permission to copy, distribute and modify it.
  8214. ## -------------------- ##
  8215. @@ -5448,7 +5451,7 @@ else
  8216. lt_cv_sys_max_cmd_len=8192;
  8217. ;;
  8218. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8219. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8220. # This has been around since 386BSD, at least. Likely further.
  8221. if test -x /sbin/sysctl; then
  8222. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  8223. @@ -5886,6 +5889,10 @@ openbsd*)
  8224. fi
  8225. ;;
  8226. +hyperbolabsd*)
  8227. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  8228. + ;;
  8229. +
  8230. osf3* | osf4* | osf5*)
  8231. lt_cv_deplibs_check_method=pass_all
  8232. ;;
  8233. @@ -9022,6 +9029,11 @@ _LT_EOF
  8234. fi
  8235. ;;
  8236. + hyperbolabsd*)
  8237. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8238. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8239. + ;;
  8240. +
  8241. solaris*)
  8242. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8243. ld_shlibs=no
  8244. @@ -9608,6 +9620,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8245. fi
  8246. ;;
  8247. + hyperbolabsd*)
  8248. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8249. + hardcode_direct=yes
  8250. + hardcode_shlibpath_var=no
  8251. + hardcode_direct_absolute=yes
  8252. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8253. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  8254. + else
  8255. + ld_shlibs=no
  8256. + fi
  8257. + ;;
  8258. +
  8259. os2*)
  8260. hardcode_libdir_flag_spec='-L$libdir'
  8261. hardcode_minus_L=yes
  8262. @@ -10595,6 +10619,16 @@ openbsd*)
  8263. fi
  8264. ;;
  8265. +hyperbolabsd*)
  8266. + version_type=sunos
  8267. + need_lib_prefix=no
  8268. + need_version=no
  8269. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8270. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8271. + shlibpath_var=LD_LIBRARY_PATH
  8272. + shlibpath_overrides_runpath=yes
  8273. + ;;
  8274. +
  8275. os2*)
  8276. libname_spec='$name'
  8277. shrext_cmds=".dll"
  8278. @@ -12882,6 +12916,11 @@ _LT_EOF
  8279. fi
  8280. ;;
  8281. + hyperbolabsd*)
  8282. + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8283. + archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8284. + ;;
  8285. +
  8286. solaris*)
  8287. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8288. ld_shlibs_FC=no
  8289. @@ -13416,6 +13455,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8290. fi
  8291. ;;
  8292. + hyperbolabsd*)
  8293. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8294. + hardcode_direct_FC=yes
  8295. + hardcode_shlibpath_var_FC=no
  8296. + hardcode_direct_absolute_FC=yes
  8297. + archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8298. + hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
  8299. + else
  8300. + ld_shlibs_FC=no
  8301. + fi
  8302. + ;;
  8303. +
  8304. os2*)
  8305. hardcode_libdir_flag_spec_FC='-L$libdir'
  8306. hardcode_minus_L_FC=yes
  8307. @@ -14229,6 +14280,16 @@ openbsd*)
  8308. fi
  8309. ;;
  8310. +hyperbolabsd*)
  8311. + version_type=sunos
  8312. + need_lib_prefix=no
  8313. + need_version=no
  8314. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8315. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8316. + shlibpath_var=LD_LIBRARY_PATH
  8317. + shlibpath_overrides_runpath=yes
  8318. + ;;
  8319. +
  8320. os2*)
  8321. libname_spec='$name'
  8322. shrext_cmds=".dll"
  8323. diff --git a/libhsail-rt/configure b/libhsail-rt/configure
  8324. index a4fcc10..4871b35 100755
  8325. --- a/libhsail-rt/configure
  8326. +++ b/libhsail-rt/configure
  8327. @@ -8,6 +8,9 @@
  8328. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8329. # Foundation, Inc.
  8330. #
  8331. +# Modifications to support HyperbolaBSD:
  8332. +# Copyright (C) 2020-2024 Hyperbola Project
  8333. +#
  8334. # This configure script is free software; the Free Software Foundation
  8335. # gives unlimited permission to copy, distribute and modify it.
  8336. ## -------------------- ##
  8337. @@ -5265,7 +5268,7 @@ else
  8338. lt_cv_sys_max_cmd_len=8192;
  8339. ;;
  8340. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8341. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8342. # This has been around since 386BSD, at least. Likely further.
  8343. if test -x /sbin/sysctl; then
  8344. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  8345. @@ -5703,6 +5706,10 @@ openbsd*)
  8346. fi
  8347. ;;
  8348. +hyperbolabsd*)
  8349. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  8350. + ;;
  8351. +
  8352. osf3* | osf4* | osf5*)
  8353. lt_cv_deplibs_check_method=pass_all
  8354. ;;
  8355. @@ -8838,6 +8845,11 @@ _LT_EOF
  8356. fi
  8357. ;;
  8358. + hyperbolabsd*)
  8359. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8360. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8361. + ;;
  8362. +
  8363. solaris*)
  8364. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8365. ld_shlibs=no
  8366. @@ -9424,6 +9436,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8367. fi
  8368. ;;
  8369. + hyperbolabsd*)
  8370. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8371. + hardcode_direct=yes
  8372. + hardcode_shlibpath_var=no
  8373. + hardcode_direct_absolute=yes
  8374. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8375. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  8376. + else
  8377. + ld_shlibs=no
  8378. + fi
  8379. + ;;
  8380. +
  8381. os2*)
  8382. hardcode_libdir_flag_spec='-L$libdir'
  8383. hardcode_minus_L=yes
  8384. @@ -10411,6 +10435,16 @@ openbsd*)
  8385. fi
  8386. ;;
  8387. +hyperbolabsd*)
  8388. + version_type=sunos
  8389. + need_lib_prefix=no
  8390. + need_version=no
  8391. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8392. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8393. + shlibpath_var=LD_LIBRARY_PATH
  8394. + shlibpath_overrides_runpath=yes
  8395. + ;;
  8396. +
  8397. os2*)
  8398. libname_spec='$name'
  8399. shrext_cmds=".dll"
  8400. @@ -12389,6 +12423,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  8401. fi
  8402. ;;
  8403. + hyperbolabsd*)
  8404. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8405. + hardcode_direct_CXX=yes
  8406. + hardcode_shlibpath_var_CXX=no
  8407. + hardcode_direct_absolute_CXX=yes
  8408. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8409. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  8410. + else
  8411. + ld_shlibs_CXX=no
  8412. + fi
  8413. + ;;
  8414. +
  8415. osf3* | osf4* | osf5*)
  8416. case $cc_basename in
  8417. KCC*)
  8418. @@ -13087,7 +13133,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  8419. ;;
  8420. esac
  8421. ;;
  8422. - netbsd*)
  8423. + netbsd* | hyperbolabsd*)
  8424. ;;
  8425. *qnx* | *nto*)
  8426. # QNX uses GNU C++, but need to define -shared option too, otherwise
  8427. @@ -14071,6 +14117,16 @@ openbsd*)
  8428. fi
  8429. ;;
  8430. +hyperbolabsd*)
  8431. + version_type=sunos
  8432. + need_lib_prefix=no
  8433. + need_version=no
  8434. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8435. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8436. + shlibpath_var=LD_LIBRARY_PATH
  8437. + shlibpath_overrides_runpath=yes
  8438. + ;;
  8439. +
  8440. os2*)
  8441. libname_spec='$name'
  8442. shrext_cmds=".dll"
  8443. diff --git a/libitm/configure b/libitm/configure
  8444. index dbf386d..5f34589 100644
  8445. --- a/libitm/configure
  8446. +++ b/libitm/configure
  8447. @@ -6,6 +6,9 @@
  8448. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8449. # Foundation, Inc.
  8450. #
  8451. +# Modifications to support HyperbolaBSD:
  8452. +# Copyright (C) 2020-2024 Hyperbola Project
  8453. +#
  8454. # This configure script is free software; the Free Software Foundation
  8455. # gives unlimited permission to copy, distribute and modify it.
  8456. ## -------------------- ##
  8457. @@ -6086,7 +6089,7 @@ else
  8458. lt_cv_sys_max_cmd_len=8192;
  8459. ;;
  8460. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8461. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8462. # This has been around since 386BSD, at least. Likely further.
  8463. if test -x /sbin/sysctl; then
  8464. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  8465. @@ -6524,6 +6527,10 @@ openbsd*)
  8466. fi
  8467. ;;
  8468. +hyperbolabsd*)
  8469. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  8470. + ;;
  8471. +
  8472. osf3* | osf4* | osf5*)
  8473. lt_cv_deplibs_check_method=pass_all
  8474. ;;
  8475. @@ -9661,6 +9668,11 @@ _LT_EOF
  8476. fi
  8477. ;;
  8478. + hyperbolabsd*)
  8479. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8480. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8481. + ;;
  8482. +
  8483. solaris*)
  8484. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8485. ld_shlibs=no
  8486. @@ -10247,6 +10259,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8487. fi
  8488. ;;
  8489. + hyperbolabsd*)
  8490. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8491. + hardcode_direct=yes
  8492. + hardcode_shlibpath_var=no
  8493. + hardcode_direct_absolute=yes
  8494. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8495. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  8496. + else
  8497. + ld_shlibs=no
  8498. + fi
  8499. + ;;
  8500. +
  8501. os2*)
  8502. hardcode_libdir_flag_spec='-L$libdir'
  8503. hardcode_minus_L=yes
  8504. @@ -11234,6 +11258,16 @@ openbsd*)
  8505. fi
  8506. ;;
  8507. +hyperbolabsd*)
  8508. + version_type=sunos
  8509. + need_lib_prefix=no
  8510. + need_version=no
  8511. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8512. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8513. + shlibpath_var=LD_LIBRARY_PATH
  8514. + shlibpath_overrides_runpath=yes
  8515. + ;;
  8516. +
  8517. os2*)
  8518. libname_spec='$name'
  8519. shrext_cmds=".dll"
  8520. @@ -13212,6 +13246,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  8521. fi
  8522. ;;
  8523. + hyperbolabsd*)
  8524. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8525. + hardcode_direct_CXX=yes
  8526. + hardcode_shlibpath_var_CXX=no
  8527. + hardcode_direct_absolute_CXX=yes
  8528. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8529. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  8530. + else
  8531. + ld_shlibs_CXX=no
  8532. + fi
  8533. + ;;
  8534. +
  8535. osf3* | osf4* | osf5*)
  8536. case $cc_basename in
  8537. KCC*)
  8538. @@ -13910,7 +13956,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  8539. ;;
  8540. esac
  8541. ;;
  8542. - netbsd*)
  8543. + netbsd* | hyperbolabsd*)
  8544. ;;
  8545. *qnx* | *nto*)
  8546. # QNX uses GNU C++, but need to define -shared option too, otherwise
  8547. @@ -14894,6 +14940,16 @@ openbsd*)
  8548. fi
  8549. ;;
  8550. +hyperbolabsd*)
  8551. + version_type=sunos
  8552. + need_lib_prefix=no
  8553. + need_version=no
  8554. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8555. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8556. + shlibpath_var=LD_LIBRARY_PATH
  8557. + shlibpath_overrides_runpath=yes
  8558. + ;;
  8559. +
  8560. os2*)
  8561. libname_spec='$name'
  8562. shrext_cmds=".dll"
  8563. diff --git a/libitm/configure.tgt b/libitm/configure.tgt
  8564. index 0cbb097..4b07b4a 100644
  8565. --- a/libitm/configure.tgt
  8566. +++ b/libitm/configure.tgt
  8567. @@ -1,5 +1,8 @@
  8568. # -*- shell-script -*-
  8569. # Copyright (C) 2011-2018 Free Software Foundation, Inc.
  8570. +#
  8571. +# Modifications to support HyperbolaBSD:
  8572. +# Copyright (C) 2020-2024 Hyperbola Project
  8573. # This program is free software; you can redistribute it and/or modify
  8574. # it under the terms of the GNU General Public License as published by
  8575. @@ -140,8 +143,10 @@ case "${target}" in
  8576. *-*-gnu* | *-*-k*bsd*-gnu \
  8577. | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
  8578. + | *-*-hyperbolabsd* \
  8579. | *-*-solaris2* | *-*-sysv4* | *-*-hpux11* \
  8580. - | *-*-darwin* | *-*-aix* | *-*-dragonfly*)
  8581. + | *-*-darwin* | *-*-aix* | *-*-dragonfly*
  8582. + | *-*-hyperbolabsd*)
  8583. # POSIX system. The OS is supported.
  8584. ;;
  8585. diff --git a/libmpx/configure b/libmpx/configure
  8586. index 7085659..783110c 100644
  8587. --- a/libmpx/configure
  8588. +++ b/libmpx/configure
  8589. @@ -8,6 +8,9 @@
  8590. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8591. # Foundation, Inc.
  8592. #
  8593. +# Modifications to support HyperbolaBSD:
  8594. +# Copyright (C) 2020-2024 Hyperbola Project
  8595. +#
  8596. # This configure script is free software; the Free Software Foundation
  8597. # gives unlimited permission to copy, distribute and modify it.
  8598. ## -------------------- ##
  8599. @@ -5798,7 +5801,7 @@ else
  8600. lt_cv_sys_max_cmd_len=8192;
  8601. ;;
  8602. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8603. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8604. # This has been around since 386BSD, at least. Likely further.
  8605. if test -x /sbin/sysctl; then
  8606. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  8607. @@ -6236,6 +6239,10 @@ openbsd*)
  8608. fi
  8609. ;;
  8610. +hyperbolabsd*)
  8611. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  8612. + ;;
  8613. +
  8614. osf3* | osf4* | osf5*)
  8615. lt_cv_deplibs_check_method=pass_all
  8616. ;;
  8617. @@ -9101,6 +9108,11 @@ _LT_EOF
  8618. fi
  8619. ;;
  8620. + hyperbolabsd*)
  8621. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8622. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8623. + ;;
  8624. +
  8625. solaris*)
  8626. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8627. ld_shlibs=no
  8628. @@ -9687,6 +9699,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8629. fi
  8630. ;;
  8631. + hyperbolabsd*)
  8632. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8633. + hardcode_direct=yes
  8634. + hardcode_shlibpath_var=no
  8635. + hardcode_direct_absolute=yes
  8636. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8637. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  8638. + else
  8639. + ld_shlibs=no
  8640. + fi
  8641. + ;;
  8642. +
  8643. os2*)
  8644. hardcode_libdir_flag_spec='-L$libdir'
  8645. hardcode_minus_L=yes
  8646. @@ -10674,6 +10698,16 @@ openbsd*)
  8647. fi
  8648. ;;
  8649. +hyperbolabsd*)
  8650. + version_type=sunos
  8651. + need_lib_prefix=no
  8652. + need_version=no
  8653. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8654. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8655. + shlibpath_var=LD_LIBRARY_PATH
  8656. + shlibpath_overrides_runpath=yes
  8657. + ;;
  8658. +
  8659. os2*)
  8660. libname_spec='$name'
  8661. shrext_cmds=".dll"
  8662. diff --git a/libobjc/configure b/libobjc/configure
  8663. index d1a032f..bdd1f00 100755
  8664. --- a/libobjc/configure
  8665. +++ b/libobjc/configure
  8666. @@ -6,6 +6,9 @@
  8667. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8668. # Foundation, Inc.
  8669. #
  8670. +# Modifications to support HyperbolaBSD:
  8671. +# Copyright (C) 2020-2024 Hyperbola Project
  8672. +#
  8673. # This configure script is free software; the Free Software Foundation
  8674. # gives unlimited permission to copy, distribute and modify it.
  8675. ## -------------------- ##
  8676. @@ -4904,7 +4907,7 @@ else
  8677. lt_cv_sys_max_cmd_len=8192;
  8678. ;;
  8679. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8680. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8681. # This has been around since 386BSD, at least. Likely further.
  8682. if test -x /sbin/sysctl; then
  8683. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  8684. @@ -5339,6 +5342,10 @@ openbsd*)
  8685. fi
  8686. ;;
  8687. +hyperbolabsd*)
  8688. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  8689. + ;;
  8690. +
  8691. osf3* | osf4* | osf5*)
  8692. lt_cv_deplibs_check_method=pass_all
  8693. ;;
  8694. @@ -8520,6 +8527,11 @@ _LT_EOF
  8695. fi
  8696. ;;
  8697. + hyperbolabsd*)
  8698. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8699. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8700. + ;;
  8701. +
  8702. solaris*)
  8703. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8704. ld_shlibs=no
  8705. @@ -9115,6 +9127,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8706. fi
  8707. ;;
  8708. + hyperbolabsd*)
  8709. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8710. + hardcode_direct=yes
  8711. + hardcode_shlibpath_var=no
  8712. + hardcode_direct_absolute=yes
  8713. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8714. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  8715. + else
  8716. + ld_shlibs=no
  8717. + fi
  8718. + ;;
  8719. +
  8720. os2*)
  8721. hardcode_libdir_flag_spec='-L$libdir'
  8722. hardcode_minus_L=yes
  8723. @@ -10105,6 +10129,16 @@ openbsd*)
  8724. fi
  8725. ;;
  8726. +hyperbolabsd*)
  8727. + version_type=sunos
  8728. + need_lib_prefix=no
  8729. + need_version=no
  8730. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8731. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8732. + shlibpath_var=LD_LIBRARY_PATH
  8733. + shlibpath_overrides_runpath=yes
  8734. + ;;
  8735. +
  8736. os2*)
  8737. libname_spec='$name'
  8738. shrext_cmds=".dll"
  8739. diff --git a/liboffloadmic/configure b/liboffloadmic/configure
  8740. index f873716..b5a40de 100644
  8741. --- a/liboffloadmic/configure
  8742. +++ b/liboffloadmic/configure
  8743. @@ -6,6 +6,9 @@
  8744. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8745. # Foundation, Inc.
  8746. #
  8747. +# Modifications to support HyperbolaBSD:
  8748. +# Copyright (C) 2020-2024 Hyperbola Project
  8749. +#
  8750. # This configure script is free software; the Free Software Foundation
  8751. # gives unlimited permission to copy, distribute and modify it.
  8752. ## -------------------- ##
  8753. @@ -5669,7 +5672,7 @@ else
  8754. lt_cv_sys_max_cmd_len=8192;
  8755. ;;
  8756. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8757. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8758. # This has been around since 386BSD, at least. Likely further.
  8759. if test -x /sbin/sysctl; then
  8760. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  8761. @@ -6107,6 +6110,10 @@ openbsd*)
  8762. fi
  8763. ;;
  8764. +hyperbolabsd*)
  8765. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  8766. + ;;
  8767. +
  8768. osf3* | osf4* | osf5*)
  8769. lt_cv_deplibs_check_method=pass_all
  8770. ;;
  8771. @@ -8973,6 +8980,11 @@ _LT_EOF
  8772. fi
  8773. ;;
  8774. + hyperbolabsd*)
  8775. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8776. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8777. + ;;
  8778. +
  8779. solaris*)
  8780. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8781. ld_shlibs=no
  8782. @@ -9559,6 +9571,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8783. fi
  8784. ;;
  8785. + hyperbolabsd*)
  8786. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8787. + hardcode_direct=yes
  8788. + hardcode_shlibpath_var=no
  8789. + hardcode_direct_absolute=yes
  8790. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8791. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  8792. + else
  8793. + ld_shlibs=no
  8794. + fi
  8795. + ;;
  8796. +
  8797. os2*)
  8798. hardcode_libdir_flag_spec='-L$libdir'
  8799. hardcode_minus_L=yes
  8800. @@ -10546,6 +10570,16 @@ openbsd*)
  8801. fi
  8802. ;;
  8803. +hyperbolabsd*)
  8804. + version_type=sunos
  8805. + need_lib_prefix=no
  8806. + need_version=no
  8807. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8808. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8809. + shlibpath_var=LD_LIBRARY_PATH
  8810. + shlibpath_overrides_runpath=yes
  8811. + ;;
  8812. +
  8813. os2*)
  8814. libname_spec='$name'
  8815. shrext_cmds=".dll"
  8816. @@ -12524,6 +12558,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  8817. fi
  8818. ;;
  8819. + hyperbolabsd*)
  8820. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8821. + hardcode_direct_CXX=yes
  8822. + hardcode_shlibpath_var_CXX=no
  8823. + hardcode_direct_absolute_CXX=yes
  8824. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8825. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  8826. + else
  8827. + ld_shlibs_CXX=no
  8828. + fi
  8829. + ;;
  8830. +
  8831. osf3* | osf4* | osf5*)
  8832. case $cc_basename in
  8833. KCC*)
  8834. @@ -13222,7 +13268,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  8835. ;;
  8836. esac
  8837. ;;
  8838. - netbsd*)
  8839. + netbsd* | hyperbolabsd*)
  8840. ;;
  8841. *qnx* | *nto*)
  8842. # QNX uses GNU C++, but need to define -shared option too, otherwise
  8843. @@ -14206,6 +14252,16 @@ openbsd*)
  8844. fi
  8845. ;;
  8846. +hyperbolabsd*)
  8847. + version_type=sunos
  8848. + need_lib_prefix=no
  8849. + need_version=no
  8850. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8851. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8852. + shlibpath_var=LD_LIBRARY_PATH
  8853. + shlibpath_overrides_runpath=yes
  8854. + ;;
  8855. +
  8856. os2*)
  8857. libname_spec='$name'
  8858. shrext_cmds=".dll"
  8859. diff --git a/liboffloadmic/plugin/configure b/liboffloadmic/plugin/configure
  8860. index c031eb3..80033fd 100644
  8861. --- a/liboffloadmic/plugin/configure
  8862. +++ b/liboffloadmic/plugin/configure
  8863. @@ -6,6 +6,9 @@
  8864. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8865. # Foundation, Inc.
  8866. #
  8867. +# Modifications to support HyperbolaBSD:
  8868. +# Copyright (C) 2020-2024 Hyperbola Project
  8869. +#
  8870. # This configure script is free software; the Free Software Foundation
  8871. # gives unlimited permission to copy, distribute and modify it.
  8872. ## -------------------- ##
  8873. @@ -5107,7 +5110,7 @@ else
  8874. lt_cv_sys_max_cmd_len=8192;
  8875. ;;
  8876. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8877. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8878. # This has been around since 386BSD, at least. Likely further.
  8879. if test -x /sbin/sysctl; then
  8880. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  8881. @@ -5545,6 +5548,10 @@ openbsd*)
  8882. fi
  8883. ;;
  8884. +hyperbolabsd*)
  8885. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  8886. + ;;
  8887. +
  8888. osf3* | osf4* | osf5*)
  8889. lt_cv_deplibs_check_method=pass_all
  8890. ;;
  8891. @@ -8680,6 +8687,11 @@ _LT_EOF
  8892. fi
  8893. ;;
  8894. + hyperbolabsd*)
  8895. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8896. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8897. + ;;
  8898. +
  8899. solaris*)
  8900. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  8901. ld_shlibs=no
  8902. @@ -9266,6 +9278,18 @@ rm -f core conftest.err conftest.$ac_objext \
  8903. fi
  8904. ;;
  8905. + hyperbolabsd*)
  8906. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8907. + hardcode_direct=yes
  8908. + hardcode_shlibpath_var=no
  8909. + hardcode_direct_absolute=yes
  8910. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8911. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  8912. + else
  8913. + ld_shlibs=no
  8914. + fi
  8915. + ;;
  8916. +
  8917. os2*)
  8918. hardcode_libdir_flag_spec='-L$libdir'
  8919. hardcode_minus_L=yes
  8920. @@ -10253,6 +10277,16 @@ openbsd*)
  8921. fi
  8922. ;;
  8923. +hyperbolabsd*)
  8924. + version_type=sunos
  8925. + need_lib_prefix=no
  8926. + need_version=no
  8927. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8928. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8929. + shlibpath_var=LD_LIBRARY_PATH
  8930. + shlibpath_overrides_runpath=yes
  8931. + ;;
  8932. +
  8933. os2*)
  8934. libname_spec='$name'
  8935. shrext_cmds=".dll"
  8936. @@ -12231,6 +12265,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  8937. fi
  8938. ;;
  8939. + hyperbolabsd*)
  8940. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  8941. + hardcode_direct_CXX=yes
  8942. + hardcode_shlibpath_var_CXX=no
  8943. + hardcode_direct_absolute_CXX=yes
  8944. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  8945. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  8946. + else
  8947. + ld_shlibs_CXX=no
  8948. + fi
  8949. + ;;
  8950. +
  8951. osf3* | osf4* | osf5*)
  8952. case $cc_basename in
  8953. KCC*)
  8954. @@ -12929,7 +12975,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  8955. ;;
  8956. esac
  8957. ;;
  8958. - netbsd*)
  8959. + netbsd* | hyperbolabsd*)
  8960. ;;
  8961. *qnx* | *nto*)
  8962. # QNX uses GNU C++, but need to define -shared option too, otherwise
  8963. @@ -13913,6 +13959,16 @@ openbsd*)
  8964. fi
  8965. ;;
  8966. +hyperbolabsd*)
  8967. + version_type=sunos
  8968. + need_lib_prefix=no
  8969. + need_version=no
  8970. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  8971. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  8972. + shlibpath_var=LD_LIBRARY_PATH
  8973. + shlibpath_overrides_runpath=yes
  8974. + ;;
  8975. +
  8976. os2*)
  8977. libname_spec='$name'
  8978. shrext_cmds=".dll"
  8979. diff --git a/libquadmath/configure b/libquadmath/configure
  8980. index 14610d6..bb1fecc 100755
  8981. --- a/libquadmath/configure
  8982. +++ b/libquadmath/configure
  8983. @@ -6,6 +6,9 @@
  8984. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  8985. # Foundation, Inc.
  8986. #
  8987. +# Modifications to support HyperbolaBSD:
  8988. +# Copyright (C) 2020-2024 Hyperbola Project
  8989. +#
  8990. # This configure script is free software; the Free Software Foundation
  8991. # gives unlimited permission to copy, distribute and modify it.
  8992. ## -------------------- ##
  8993. @@ -5102,7 +5105,7 @@ else
  8994. lt_cv_sys_max_cmd_len=8192;
  8995. ;;
  8996. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  8997. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  8998. # This has been around since 386BSD, at least. Likely further.
  8999. if test -x /sbin/sysctl; then
  9000. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  9001. @@ -5540,6 +5543,10 @@ openbsd*)
  9002. fi
  9003. ;;
  9004. +hyperbolabsd*)
  9005. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  9006. + ;;
  9007. +
  9008. osf3* | osf4* | osf5*)
  9009. lt_cv_deplibs_check_method=pass_all
  9010. ;;
  9011. @@ -8413,6 +8420,11 @@ _LT_EOF
  9012. fi
  9013. ;;
  9014. + hyperbolabsd*)
  9015. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  9016. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  9017. + ;;
  9018. +
  9019. solaris*)
  9020. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  9021. ld_shlibs=no
  9022. @@ -9008,6 +9020,18 @@ rm -f core conftest.err conftest.$ac_objext \
  9023. fi
  9024. ;;
  9025. + hyperbolabsd*)
  9026. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9027. + hardcode_direct=yes
  9028. + hardcode_shlibpath_var=no
  9029. + hardcode_direct_absolute=yes
  9030. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9031. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  9032. + else
  9033. + ld_shlibs=no
  9034. + fi
  9035. + ;;
  9036. +
  9037. os2*)
  9038. hardcode_libdir_flag_spec='-L$libdir'
  9039. hardcode_minus_L=yes
  9040. @@ -9998,6 +10022,16 @@ openbsd*)
  9041. fi
  9042. ;;
  9043. +hyperbolabsd*)
  9044. + version_type=sunos
  9045. + need_lib_prefix=no
  9046. + need_version=no
  9047. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9048. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9049. + shlibpath_var=LD_LIBRARY_PATH
  9050. + shlibpath_overrides_runpath=yes
  9051. + ;;
  9052. +
  9053. os2*)
  9054. libname_spec='$name'
  9055. shrext_cmds=".dll"
  9056. diff --git a/libsanitizer/configure b/libsanitizer/configure
  9057. index 4695bc7..79c8df9 100755
  9058. --- a/libsanitizer/configure
  9059. +++ b/libsanitizer/configure
  9060. @@ -8,6 +8,9 @@
  9061. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  9062. # Foundation, Inc.
  9063. #
  9064. +# Modifications to support HyperbolaBSD:
  9065. +# Copyright (C) 2020-2024 Hyperbola Project
  9066. +#
  9067. # This configure script is free software; the Free Software Foundation
  9068. # gives unlimited permission to copy, distribute and modify it.
  9069. ## -------------------- ##
  9070. @@ -6598,7 +6601,7 @@ else
  9071. lt_cv_sys_max_cmd_len=8192;
  9072. ;;
  9073. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  9074. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  9075. # This has been around since 386BSD, at least. Likely further.
  9076. if test -x /sbin/sysctl; then
  9077. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  9078. @@ -7036,6 +7039,10 @@ openbsd*)
  9079. fi
  9080. ;;
  9081. +hyperbolabsd*)
  9082. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  9083. + ;;
  9084. +
  9085. osf3* | osf4* | osf5*)
  9086. lt_cv_deplibs_check_method=pass_all
  9087. ;;
  9088. @@ -9902,6 +9909,11 @@ _LT_EOF
  9089. fi
  9090. ;;
  9091. + hyperbolabsd*)
  9092. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  9093. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  9094. + ;;
  9095. +
  9096. solaris*)
  9097. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  9098. ld_shlibs=no
  9099. @@ -10488,6 +10500,18 @@ rm -f core conftest.err conftest.$ac_objext \
  9100. fi
  9101. ;;
  9102. + hyperbolabsd*)
  9103. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9104. + hardcode_direct=yes
  9105. + hardcode_shlibpath_var=no
  9106. + hardcode_direct_absolute=yes
  9107. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9108. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  9109. + else
  9110. + ld_shlibs=no
  9111. + fi
  9112. + ;;
  9113. +
  9114. os2*)
  9115. hardcode_libdir_flag_spec='-L$libdir'
  9116. hardcode_minus_L=yes
  9117. @@ -11475,6 +11499,16 @@ openbsd*)
  9118. fi
  9119. ;;
  9120. +hyperbolabsd*)
  9121. + version_type=sunos
  9122. + need_lib_prefix=no
  9123. + need_version=no
  9124. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9125. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9126. + shlibpath_var=LD_LIBRARY_PATH
  9127. + shlibpath_overrides_runpath=yes
  9128. + ;;
  9129. +
  9130. os2*)
  9131. libname_spec='$name'
  9132. shrext_cmds=".dll"
  9133. @@ -13453,6 +13487,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  9134. fi
  9135. ;;
  9136. + hyperbolabsd*)
  9137. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9138. + hardcode_direct_CXX=yes
  9139. + hardcode_shlibpath_var_CXX=no
  9140. + hardcode_direct_absolute_CXX=yes
  9141. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9142. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  9143. + else
  9144. + ld_shlibs_CXX=no
  9145. + fi
  9146. + ;;
  9147. +
  9148. osf3* | osf4* | osf5*)
  9149. case $cc_basename in
  9150. KCC*)
  9151. @@ -14151,7 +14197,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  9152. ;;
  9153. esac
  9154. ;;
  9155. - netbsd*)
  9156. + netbsd* | hyperbolabsd*)
  9157. ;;
  9158. *qnx* | *nto*)
  9159. # QNX uses GNU C++, but need to define -shared option too, otherwise
  9160. @@ -15135,6 +15181,16 @@ openbsd*)
  9161. fi
  9162. ;;
  9163. +hyperbolabsd*)
  9164. + version_type=sunos
  9165. + need_lib_prefix=no
  9166. + need_version=no
  9167. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9168. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9169. + shlibpath_var=LD_LIBRARY_PATH
  9170. + shlibpath_overrides_runpath=yes
  9171. + ;;
  9172. +
  9173. os2*)
  9174. libname_spec='$name'
  9175. shrext_cmds=".dll"
  9176. diff --git a/libssp/configure b/libssp/configure
  9177. index 4e88e49..ca2ca79 100755
  9178. --- a/libssp/configure
  9179. +++ b/libssp/configure
  9180. @@ -6,6 +6,9 @@
  9181. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  9182. # Foundation, Inc.
  9183. #
  9184. +# Modifications to support HyperbolaBSD:
  9185. +# Copyright (C) 2020-2024 Hyperbola Project
  9186. +#
  9187. # This configure script is free software; the Free Software Foundation
  9188. # gives unlimited permission to copy, distribute and modify it.
  9189. ## -------------------- ##
  9190. @@ -5286,7 +5289,7 @@ else
  9191. lt_cv_sys_max_cmd_len=8192;
  9192. ;;
  9193. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  9194. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  9195. # This has been around since 386BSD, at least. Likely further.
  9196. if test -x /sbin/sysctl; then
  9197. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  9198. @@ -5724,6 +5727,10 @@ openbsd*)
  9199. fi
  9200. ;;
  9201. +hyperbolabsd*)
  9202. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  9203. + ;;
  9204. +
  9205. osf3* | osf4* | osf5*)
  9206. lt_cv_deplibs_check_method=pass_all
  9207. ;;
  9208. @@ -8597,6 +8604,11 @@ _LT_EOF
  9209. fi
  9210. ;;
  9211. + hyperbolabsd*)
  9212. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  9213. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  9214. + ;;
  9215. +
  9216. solaris*)
  9217. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  9218. ld_shlibs=no
  9219. @@ -9192,6 +9204,18 @@ rm -f core conftest.err conftest.$ac_objext \
  9220. fi
  9221. ;;
  9222. + hyperbolabsd*)
  9223. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9224. + hardcode_direct=yes
  9225. + hardcode_shlibpath_var=no
  9226. + hardcode_direct_absolute=yes
  9227. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9228. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  9229. + else
  9230. + ld_shlibs=no
  9231. + fi
  9232. + ;;
  9233. +
  9234. os2*)
  9235. hardcode_libdir_flag_spec='-L$libdir'
  9236. hardcode_minus_L=yes
  9237. @@ -10182,6 +10206,16 @@ openbsd*)
  9238. fi
  9239. ;;
  9240. +hyperbolabsd*)
  9241. + version_type=sunos
  9242. + need_lib_prefix=no
  9243. + need_version=no
  9244. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9245. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9246. + shlibpath_var=LD_LIBRARY_PATH
  9247. + shlibpath_overrides_runpath=yes
  9248. + ;;
  9249. +
  9250. os2*)
  9251. libname_spec='$name'
  9252. shrext_cmds=".dll"
  9253. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
  9254. index b380a26..5b320c3 100644
  9255. --- a/libstdc++-v3/acinclude.m4
  9256. +++ b/libstdc++-v3/acinclude.m4
  9257. @@ -1431,7 +1431,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
  9258. ac_has_nanosleep=yes
  9259. ac_has_sched_yield=yes
  9260. ;;
  9261. - openbsd*)
  9262. + openbsd*|hyperbolabsd*)
  9263. ac_has_clock_monotonic=yes
  9264. ac_has_clock_realtime=yes
  9265. ac_has_nanosleep=yes
  9266. @@ -2422,7 +2422,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
  9267. dragonfly* | freebsd*)
  9268. enable_clocale_flag=dragonfly
  9269. ;;
  9270. - openbsd*)
  9271. + openbsd* | hyperbolabsd*)
  9272. enable_clocale_flag=newlib
  9273. ;;
  9274. *)
  9275. @@ -4290,7 +4290,7 @@ AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [
  9276. fi
  9277. if test x"$enable_libstdcxx_filesystem_ts" = x"auto"; then
  9278. case "${target_os}" in
  9279. - freebsd*|netbsd*|openbsd*|dragonfly*|darwin*)
  9280. + freebsd*|netbsd*|openbsd*|dragonfly*|darwin*|hyperbolabsd*)
  9281. enable_libstdcxx_filesystem_ts=yes
  9282. ;;
  9283. gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
  9284. diff --git b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_base.h b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_base.h
  9285. new file mode 100644
  9286. index 0000000..ad427d0
  9287. --- /dev/null
  9288. +++ b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_base.h
  9289. @@ -0,0 +1,65 @@
  9290. +// Locale support -*- C++ -*-
  9291. +
  9292. +// Copyright (C) 2000-2018 Free Software Foundation, Inc.
  9293. +//
  9294. +// Modifications to support HyperbolaBSD:
  9295. +// Copyright (C) 2020-2024 Hyperbola Project
  9296. +//
  9297. +// This file is part of the GNU ISO C++ Library. This library is free
  9298. +// software; you can redistribute it and/or modify it under the
  9299. +// terms of the GNU General Public License as published by the
  9300. +// Free Software Foundation; either version 3, or (at your option)
  9301. +// any later version.
  9302. +
  9303. +// This library is distributed in the hope that it will be useful,
  9304. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  9305. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9306. +// GNU General Public License for more details.
  9307. +
  9308. +// Under Section 7 of GPL version 3, you are granted additional
  9309. +// permissions described in the GCC Runtime Library Exception, version
  9310. +// 3.1, as published by the Free Software Foundation.
  9311. +
  9312. +// You should have received a copy of the GNU General Public License and
  9313. +// a copy of the GCC Runtime Library Exception along with this program;
  9314. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  9315. +// <http://www.gnu.org/licenses/>.
  9316. +
  9317. +//
  9318. +// ISO C++ 14882: 22.1 Locales
  9319. +//
  9320. +
  9321. +// Information as gleaned from /usr/include/ctype.h on HyperbolaBSD.
  9322. +
  9323. +namespace std _GLIBCXX_VISIBILITY(default)
  9324. +{
  9325. +_GLIBCXX_BEGIN_NAMESPACE_VERSION
  9326. +
  9327. + /// @brief Base class for ctype.
  9328. + struct ctype_base
  9329. + {
  9330. + // Non-standard typedefs.
  9331. + typedef const short* __to_type;
  9332. +
  9333. + // NB: Offsets into ctype<char>::_M_table force a particular size
  9334. + // on the mask type. Because of this, we don't use an enum.
  9335. + typedef char mask;
  9336. +
  9337. + static const mask upper = _U;
  9338. + static const mask lower = _L;
  9339. + static const mask alpha = _U | _L;
  9340. + static const mask digit = _N;
  9341. + static const mask xdigit = _N | _X;
  9342. + static const mask space = _S;
  9343. + static const mask print = _P | _U | _L | _N | _B;
  9344. + static const mask graph = _P | _U | _L | _N;
  9345. + static const mask cntrl = _C;
  9346. + static const mask punct = _P;
  9347. + static const mask alnum = _U | _L | _N;
  9348. +#if __cplusplus >= 201103L
  9349. + static const mask blank = space;
  9350. +#endif
  9351. + };
  9352. +
  9353. +_GLIBCXX_END_NAMESPACE_VERSION
  9354. +} // namespace
  9355. diff --git b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_configure_char.cc b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_configure_char.cc
  9356. new file mode 100644
  9357. index 0000000..bfbbce9
  9358. --- /dev/null
  9359. +++ b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_configure_char.cc
  9360. @@ -0,0 +1,102 @@
  9361. +// Locale support -*- C++ -*-
  9362. +
  9363. +// Copyright (C) 2011-2018 Free Software Foundation, Inc.
  9364. +//
  9365. +// Modifications to support HyperbolaBSD:
  9366. +// Copyright (C) 2020-2024 Hyperbola Project
  9367. +//
  9368. +// This file is part of the GNU ISO C++ Library. This library is free
  9369. +// software; you can redistribute it and/or modify it under the
  9370. +// terms of the GNU General Public License as published by the
  9371. +// Free Software Foundation; either version 3, or (at your option)
  9372. +// any later version.
  9373. +
  9374. +// This library is distributed in the hope that it will be useful,
  9375. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  9376. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9377. +// GNU General Public License for more details.
  9378. +
  9379. +// Under Section 7 of GPL version 3, you are granted additional
  9380. +// permissions described in the GCC Runtime Library Exception, version
  9381. +// 3.1, as published by the Free Software Foundation.
  9382. +
  9383. +// You should have received a copy of the GNU General Public License and
  9384. +// a copy of the GCC Runtime Library Exception along with this program;
  9385. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  9386. +// <http://www.gnu.org/licenses/>.
  9387. +
  9388. +/** @file ctype_configure_char.cc */
  9389. +
  9390. +//
  9391. +// ISO C++ 14882: 22.1 Locales
  9392. +//
  9393. +
  9394. +#include <locale>
  9395. +#include <cstdlib>
  9396. +#include <cstring>
  9397. +
  9398. +namespace std _GLIBCXX_VISIBILITY(default)
  9399. +{
  9400. +_GLIBCXX_BEGIN_NAMESPACE_VERSION
  9401. +
  9402. +// Information as gleaned from /usr/include/ctype.h
  9403. +
  9404. + const ctype_base::mask*
  9405. + ctype<char>::classic_table() throw()
  9406. + { return _ctype_ + 1; }
  9407. +
  9408. + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
  9409. + size_t __refs)
  9410. + : facet(__refs), _M_del(__table != 0 && __del),
  9411. + _M_toupper(NULL), _M_tolower(NULL),
  9412. + _M_table(__table ? __table : classic_table())
  9413. + {
  9414. + memset(_M_widen, 0, sizeof(_M_widen));
  9415. + _M_widen_ok = 0;
  9416. + memset(_M_narrow, 0, sizeof(_M_narrow));
  9417. + _M_narrow_ok = 0;
  9418. + }
  9419. +
  9420. + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
  9421. + : facet(__refs), _M_del(__table != 0 && __del),
  9422. + _M_toupper(NULL), _M_tolower(NULL),
  9423. + _M_table(__table ? __table : classic_table())
  9424. + {
  9425. + memset(_M_widen, 0, sizeof(_M_widen));
  9426. + _M_widen_ok = 0;
  9427. + memset(_M_narrow, 0, sizeof(_M_narrow));
  9428. + _M_narrow_ok = 0;
  9429. + }
  9430. +
  9431. + char
  9432. + ctype<char>::do_toupper(char __c) const
  9433. + { return ::toupper((int) __c); }
  9434. +
  9435. + const char*
  9436. + ctype<char>::do_toupper(char* __low, const char* __high) const
  9437. + {
  9438. + while (__low < __high)
  9439. + {
  9440. + *__low = ::toupper((int) *__low);
  9441. + ++__low;
  9442. + }
  9443. + return __high;
  9444. + }
  9445. +
  9446. + char
  9447. + ctype<char>::do_tolower(char __c) const
  9448. + { return ::tolower((int) __c); }
  9449. +
  9450. + const char*
  9451. + ctype<char>::do_tolower(char* __low, const char* __high) const
  9452. + {
  9453. + while (__low < __high)
  9454. + {
  9455. + *__low = ::tolower((int) *__low);
  9456. + ++__low;
  9457. + }
  9458. + return __high;
  9459. + }
  9460. +
  9461. +_GLIBCXX_END_NAMESPACE_VERSION
  9462. +} // namespace
  9463. diff --git b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_inline.h b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_inline.h
  9464. new file mode 100644
  9465. index 0000000..76654b3
  9466. --- /dev/null
  9467. +++ b/libstdc++-v3/config/os/bsd/hyperbolabsd/ctype_inline.h
  9468. @@ -0,0 +1,77 @@
  9469. +// Locale support -*- C++ -*-
  9470. +
  9471. +// Copyright (C) 2010-2018 Free Software Foundation, Inc.
  9472. +//
  9473. +// Modifications to support HyperbolaBSD:
  9474. +// Copyright (C) 2020-2024 Hyperbola Project
  9475. +//
  9476. +// This file is part of the GNU ISO C++ Library. This library is free
  9477. +// software; you can redistribute it and/or modify it under the
  9478. +// terms of the GNU General Public License as published by the
  9479. +// Free Software Foundation; either version 3, or (at your option)
  9480. +// any later version.
  9481. +
  9482. +// This library is distributed in the hope that it will be useful,
  9483. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  9484. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9485. +// GNU General Public License for more details.
  9486. +
  9487. +// Under Section 7 of GPL version 3, you are granted additional
  9488. +// permissions described in the GCC Runtime Library Exception, version
  9489. +// 3.1, as published by the Free Software Foundation.
  9490. +
  9491. +// You should have received a copy of the GNU General Public License and
  9492. +// a copy of the GCC Runtime Library Exception along with this program;
  9493. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  9494. +// <http://www.gnu.org/licenses/>.
  9495. +
  9496. +/** @file bits/ctype_inline.h
  9497. + * This is an internal header file, included by other library headers.
  9498. + * Do not attempt to use it directly. @headername{locale}
  9499. + */
  9500. +
  9501. +//
  9502. +// ISO C++ 14882: 22.1 Locales
  9503. +//
  9504. +
  9505. +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
  9506. +// functions go in ctype.cc
  9507. +
  9508. +namespace std _GLIBCXX_VISIBILITY(default)
  9509. +{
  9510. +_GLIBCXX_BEGIN_NAMESPACE_VERSION
  9511. +
  9512. + bool
  9513. + ctype<char>::
  9514. + is(mask __m, char __c) const
  9515. + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
  9516. +
  9517. + const char*
  9518. + ctype<char>::
  9519. + is(const char* __low, const char* __high, mask* __vec) const
  9520. + {
  9521. + while (__low < __high)
  9522. + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
  9523. + return __high;
  9524. + }
  9525. +
  9526. + const char*
  9527. + ctype<char>::
  9528. + scan_is(mask __m, const char* __low, const char* __high) const
  9529. + {
  9530. + while (__low < __high && !this->is(__m, *__low))
  9531. + ++__low;
  9532. + return __low;
  9533. + }
  9534. +
  9535. + const char*
  9536. + ctype<char>::
  9537. + scan_not(mask __m, const char* __low, const char* __high) const
  9538. + {
  9539. + while (__low < __high && this->is(__m, *__low) != 0)
  9540. + ++__low;
  9541. + return __low;
  9542. + }
  9543. +
  9544. +_GLIBCXX_END_NAMESPACE_VERSION
  9545. +} // namespace
  9546. diff --git b/libstdc++-v3/config/os/bsd/hyperbolabsd/os_defines.h b/libstdc++-v3/config/os/bsd/hyperbolabsd/os_defines.h
  9547. new file mode 100644
  9548. index 0000000..9a34bdf
  9549. --- /dev/null
  9550. +++ b/libstdc++-v3/config/os/bsd/hyperbolabsd/os_defines.h
  9551. @@ -0,0 +1,44 @@
  9552. +// Specific definitions for HyperbolaBSD -*- C++ -*-
  9553. +
  9554. +// Copyright (C) 2000-2018 Free Software Foundation, Inc.
  9555. +//
  9556. +// Modifications to support HyperbolaBSD:
  9557. +// Copyright (C) 2020-2024 Hyperbola Project
  9558. +//
  9559. +// This file is part of the GNU ISO C++ Library. This library is free
  9560. +// software; you can redistribute it and/or modify it under the
  9561. +// terms of the GNU General Public License as published by the
  9562. +// Free Software Foundation; either version 3, or (at your option)
  9563. +// any later version.
  9564. +
  9565. +// This library is distributed in the hope that it will be useful,
  9566. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  9567. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9568. +// GNU General Public License for more details.
  9569. +
  9570. +// Under Section 7 of GPL version 3, you are granted additional
  9571. +// permissions described in the GCC Runtime Library Exception, version
  9572. +// 3.1, as published by the Free Software Foundation.
  9573. +
  9574. +// You should have received a copy of the GNU General Public License and
  9575. +// a copy of the GCC Runtime Library Exception along with this program;
  9576. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  9577. +// <http://www.gnu.org/licenses/>.
  9578. +
  9579. +/** @file bits/os_defines.h
  9580. + * This is an internal header file, included by other library headers.
  9581. + * Do not attempt to use it directly. @headername{iosfwd}
  9582. + */
  9583. +
  9584. +#ifndef _GLIBCXX_OS_DEFINES
  9585. +#define _GLIBCXX_OS_DEFINES 1
  9586. +
  9587. +// System-specific #define, typedefs, corrections, etc, go here. This
  9588. +// file will come before all others.
  9589. +
  9590. +#define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
  9591. +#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC _GLIBCXX_USE_C99_DYNAMIC
  9592. +#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC _GLIBCXX_USE_C99_DYNAMIC
  9593. +#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC _GLIBCXX_USE_C99_DYNAMIC
  9594. +
  9595. +#endif
  9596. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
  9597. index 61457e9..fb86e32 100755
  9598. --- a/libstdc++-v3/configure
  9599. +++ b/libstdc++-v3/configure
  9600. @@ -6,6 +6,9 @@
  9601. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  9602. # Foundation, Inc.
  9603. #
  9604. +# Modifications to support HyperbolaBSD:
  9605. +# Copyright (C) 2020-2024 Hyperbola Project
  9606. +#
  9607. # This configure script is free software; the Free Software Foundation
  9608. # gives unlimited permission to copy, distribute and modify it.
  9609. ## -------------------- ##
  9610. @@ -6208,7 +6211,7 @@ else
  9611. lt_cv_sys_max_cmd_len=8192;
  9612. ;;
  9613. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  9614. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  9615. # This has been around since 386BSD, at least. Likely further.
  9616. if test -x /sbin/sysctl; then
  9617. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  9618. @@ -6646,6 +6649,10 @@ openbsd*)
  9619. fi
  9620. ;;
  9621. +hyperbolabsd*)
  9622. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  9623. + ;;
  9624. +
  9625. osf3* | osf4* | osf5*)
  9626. lt_cv_deplibs_check_method=pass_all
  9627. ;;
  9628. @@ -9648,6 +9655,11 @@ _LT_EOF
  9629. fi
  9630. ;;
  9631. + hyperbolabsd*)
  9632. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  9633. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  9634. + ;;
  9635. +
  9636. solaris*)
  9637. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  9638. ld_shlibs=no
  9639. @@ -10243,6 +10255,18 @@ rm -f core conftest.err conftest.$ac_objext \
  9640. fi
  9641. ;;
  9642. + hyperbolabsd*)
  9643. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9644. + hardcode_direct=yes
  9645. + hardcode_shlibpath_var=no
  9646. + hardcode_direct_absolute=yes
  9647. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9648. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  9649. + else
  9650. + ld_shlibs=no
  9651. + fi
  9652. + ;;
  9653. +
  9654. os2*)
  9655. hardcode_libdir_flag_spec='-L$libdir'
  9656. hardcode_minus_L=yes
  9657. @@ -11233,6 +11257,16 @@ openbsd*)
  9658. fi
  9659. ;;
  9660. +hyperbolabsd*)
  9661. + version_type=sunos
  9662. + need_lib_prefix=no
  9663. + need_version=no
  9664. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9665. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9666. + shlibpath_var=LD_LIBRARY_PATH
  9667. + shlibpath_overrides_runpath=yes
  9668. + ;;
  9669. +
  9670. os2*)
  9671. libname_spec='$name'
  9672. shrext_cmds=".dll"
  9673. @@ -13232,6 +13266,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  9674. fi
  9675. ;;
  9676. + hyperbolabsd*)
  9677. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9678. + hardcode_direct_CXX=yes
  9679. + hardcode_shlibpath_var_CXX=no
  9680. + hardcode_direct_absolute_CXX=yes
  9681. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9682. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  9683. + else
  9684. + ld_shlibs_CXX=no
  9685. + fi
  9686. + ;;
  9687. +
  9688. osf3* | osf4* | osf5*)
  9689. case $cc_basename in
  9690. KCC*)
  9691. @@ -13930,7 +13976,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
  9692. ;;
  9693. esac
  9694. ;;
  9695. - netbsd*)
  9696. + netbsd* | hyperbolabsd*)
  9697. ;;
  9698. *qnx* | *nto*)
  9699. # QNX uses GNU C++, but need to define -shared option too, otherwise
  9700. @@ -14917,6 +14963,16 @@ openbsd*)
  9701. fi
  9702. ;;
  9703. +hyperbolabsd*)
  9704. + version_type=sunos
  9705. + need_lib_prefix=no
  9706. + need_version=no
  9707. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9708. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9709. + shlibpath_var=LD_LIBRARY_PATH
  9710. + shlibpath_overrides_runpath=yes
  9711. + ;;
  9712. +
  9713. os2*)
  9714. libname_spec='$name'
  9715. shrext_cmds=".dll"
  9716. @@ -16053,7 +16109,7 @@ fi
  9717. dragonfly* | freebsd*)
  9718. enable_clocale_flag=dragonfly
  9719. ;;
  9720. - openbsd*)
  9721. + openbsd* | hyperbolabsd*)
  9722. enable_clocale_flag=newlib
  9723. ;;
  9724. *)
  9725. @@ -20814,7 +20870,7 @@ fi
  9726. ac_has_nanosleep=yes
  9727. ac_has_sched_yield=yes
  9728. ;;
  9729. - openbsd*)
  9730. + openbsd*|hyperbolabsd*)
  9731. ac_has_clock_monotonic=yes
  9732. ac_has_clock_realtime=yes
  9733. ac_has_nanosleep=yes
  9734. @@ -80288,7 +80344,7 @@ $as_echo_n "checking whether to build Filesystem TS support... " >&6; }
  9735. fi
  9736. if test x"$enable_libstdcxx_filesystem_ts" = x"auto"; then
  9737. case "${target_os}" in
  9738. - freebsd*|netbsd*|openbsd*|dragonfly*|darwin*)
  9739. + freebsd*|netbsd*|openbsd*|dragonfly*|darwin*|hyperbolabsd*)
  9740. enable_libstdcxx_filesystem_ts=yes
  9741. ;;
  9742. gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
  9743. diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
  9744. index 155a3cd..5417d5e 100644
  9745. --- a/libstdc++-v3/configure.host
  9746. +++ b/libstdc++-v3/configure.host
  9747. @@ -295,6 +295,9 @@ case "${host_os}" in
  9748. openbsd*)
  9749. os_include_dir="os/bsd/openbsd"
  9750. ;;
  9751. + hyperbolabsd*)
  9752. + os_include_dir="os/bsd/hyperbolabsd"
  9753. + ;;
  9754. qnx6.[12]*)
  9755. os_include_dir="os/qnx/qnx6.1"
  9756. c_model=c
  9757. diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html
  9758. index a7c8c30..4812224 100644
  9759. --- a/libstdc++-v3/doc/html/manual/configure.html
  9760. +++ b/libstdc++-v3/doc/html/manual/configure.html
  9761. @@ -57,9 +57,9 @@
  9762. to guess the most suitable package from the choices above. The
  9763. default is 'generic'. On glibc-based systems of sufficient
  9764. vintage (2.3 and newer), 'gnu' is automatically selected. On newlib-based
  9765. - systems (<code class="code">'--with_newlib=yes'</code>) and OpenBSD, 'newlib' is
  9766. - automatically selected. On Mac OS X 'darwin' is automatically selected.
  9767. - This option can change the library ABI.
  9768. + systems (<code class="code">'--with_newlib=yes'</code>), HyperbolaBSD and OpenBSD,
  9769. + 'newlib' is automatically selected. On Mac OS X 'darwin' is automatically
  9770. + selected. This option can change the library ABI.
  9771. </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-allocator</code></span></dt><dd><p>This is an abbreviated form of
  9772. <code class="code">'--enable-libstdcxx-allocator=auto'</code> (described
  9773. next).
  9774. @@ -250,4 +250,4 @@
  9775. as the usual libstdc++ and libsupc++ libraries. This is enabled by
  9776. default on select POSIX targets where it is known to work and disabled
  9777. otherwise.
  9778. - </p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="setup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Setup </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Make</td></tr></table></div></body></html>
  9779. \ No newline at end of file
  9780. + </p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="setup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Setup </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Make</td></tr></table></div></body></html>
  9781. diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml
  9782. index 761ef5c..7629187 100644
  9783. --- a/libstdc++-v3/doc/xml/manual/configure.xml
  9784. +++ b/libstdc++-v3/doc/xml/manual/configure.xml
  9785. @@ -103,9 +103,9 @@
  9786. to guess the most suitable package from the choices above. The
  9787. default is 'generic'. On glibc-based systems of sufficient
  9788. vintage (2.3 and newer), 'gnu' is automatically selected. On newlib-based
  9789. - systems (<code>'--with_newlib=yes'</code>) and OpenBSD, 'newlib' is
  9790. - automatically selected. On Mac OS X 'darwin' is automatically selected.
  9791. - This option can change the library ABI.
  9792. + systems (<code>'--with_newlib=yes'</code>), HyperbolaBSD and OpenBSD,
  9793. + 'newlib' is automatically selected. On Mac OS X 'darwin' is automatically
  9794. + selected. This option can change the library ABI.
  9795. </para>
  9796. </listitem></varlistentry>
  9797. diff --git a/libtool.m4 b/libtool.m4
  9798. index 24d13f3..6e6e499 100644
  9799. --- a/libtool.m4
  9800. +++ b/libtool.m4
  9801. @@ -4,6 +4,9 @@
  9802. # 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  9803. # Written by Gordon Matzigkeit, 1996
  9804. #
  9805. +# Modifications to support HyperbolaBSD:
  9806. +# Copyright (C) 2020-2024 Hyperbola Project
  9807. +#
  9808. # This file is free software; the Free Software Foundation gives
  9809. # unlimited permission to copy and/or distribute it, with or without
  9810. # modifications, as long as this notice is preserved.
  9811. @@ -13,6 +16,9 @@ m4_define([_LT_COPYING], [dnl
  9812. # 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  9813. # Written by Gordon Matzigkeit, 1996
  9814. #
  9815. +# Modifications to support HyperbolaBSD:
  9816. +# Copyright (C) 2020-2024 Hyperbola Project
  9817. +#
  9818. # This file is part of GNU Libtool.
  9819. #
  9820. # GNU Libtool is free software; you can redistribute it and/or
  9821. @@ -1513,7 +1519,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  9822. lt_cv_sys_max_cmd_len=8192;
  9823. ;;
  9824. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  9825. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  9826. # This has been around since 386BSD, at least. Likely further.
  9827. if test -x /sbin/sysctl; then
  9828. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  9829. @@ -2557,6 +2563,16 @@ openbsd*)
  9830. fi
  9831. ;;
  9832. +hyperbolabsd*)
  9833. + version_type=sunos
  9834. + need_lib_prefix=no
  9835. + need_version=no
  9836. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9837. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9838. + shlibpath_var=LD_LIBRARY_PATH
  9839. + shlibpath_overrides_runpath=yes
  9840. + ;;
  9841. +
  9842. os2*)
  9843. libname_spec='$name'
  9844. shrext_cmds=".dll"
  9845. @@ -3119,6 +3135,10 @@ openbsd*)
  9846. fi
  9847. ;;
  9848. +hyperbolabsd*)
  9849. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  9850. + ;;
  9851. +
  9852. osf3* | osf4* | osf5*)
  9853. lt_cv_deplibs_check_method=pass_all
  9854. ;;
  9855. @@ -3798,7 +3818,7 @@ m4_if([$1], [CXX], [
  9856. ;;
  9857. esac
  9858. ;;
  9859. - netbsd*)
  9860. + netbsd* | hyperbolabsd*)
  9861. ;;
  9862. *qnx* | *nto*)
  9863. # QNX uses GNU C++, but need to define -shared option too, otherwise
  9864. @@ -4534,6 +4554,11 @@ _LT_EOF
  9865. fi
  9866. ;;
  9867. + hyperbolabsd*)
  9868. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  9869. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  9870. + ;;
  9871. +
  9872. solaris*)
  9873. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  9874. _LT_TAGVAR(ld_shlibs, $1)=no
  9875. @@ -4996,6 +5021,18 @@ _LT_EOF
  9876. fi
  9877. ;;
  9878. + hyperbolabsd*)
  9879. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9880. + _LT_TAGVAR(hardcode_direct, $1)=yes
  9881. + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  9882. + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  9883. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9884. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  9885. + else
  9886. + _LT_TAGVAR(ld_shlibs, $1)=no
  9887. + fi
  9888. + ;;
  9889. +
  9890. os2*)
  9891. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  9892. _LT_TAGVAR(hardcode_minus_L, $1)=yes
  9893. @@ -6150,6 +6187,18 @@ if test "$_lt_caught_CXX_error" != yes; then
  9894. fi
  9895. ;;
  9896. + hyperbolabsd*)
  9897. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9898. + _LT_TAGVAR(hardcode_direct, $1)=yes
  9899. + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  9900. + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  9901. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9902. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  9903. + else
  9904. + _LT_TAGVAR(ld_shlibs, $1)=no
  9905. + fi
  9906. + ;;
  9907. +
  9908. osf3* | osf4* | osf5*)
  9909. case $cc_basename in
  9910. KCC*)
  9911. diff --git a/libvtv/configure b/libvtv/configure
  9912. index a197f75..7b2c3b2 100755
  9913. --- a/libvtv/configure
  9914. +++ b/libvtv/configure
  9915. @@ -6,6 +6,9 @@
  9916. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  9917. # Foundation, Inc.
  9918. #
  9919. +# Modifications to support HyperbolaBSD:
  9920. +# Copyright (C) 2020-2024 Hyperbola Project
  9921. +#
  9922. # This configure script is free software; the Free Software Foundation
  9923. # gives unlimited permission to copy, distribute and modify it.
  9924. ## -------------------- ##
  9925. @@ -6629,7 +6632,7 @@ else
  9926. lt_cv_sys_max_cmd_len=8192;
  9927. ;;
  9928. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  9929. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  9930. # This has been around since 386BSD, at least. Likely further.
  9931. if test -x /sbin/sysctl; then
  9932. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  9933. @@ -7067,6 +7070,10 @@ openbsd*)
  9934. fi
  9935. ;;
  9936. +hyperbolabsd*)
  9937. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  9938. + ;;
  9939. +
  9940. osf3* | osf4* | osf5*)
  9941. lt_cv_deplibs_check_method=pass_all
  9942. ;;
  9943. @@ -10519,6 +10526,18 @@ rm -f core conftest.err conftest.$ac_objext \
  9944. fi
  9945. ;;
  9946. + hyperbolabsd*)
  9947. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9948. + hardcode_direct=yes
  9949. + hardcode_shlibpath_var=no
  9950. + hardcode_direct_absolute=yes
  9951. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9952. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  9953. + else
  9954. + ld_shlibs=no
  9955. + fi
  9956. + ;;
  9957. +
  9958. os2*)
  9959. hardcode_libdir_flag_spec='-L$libdir'
  9960. hardcode_minus_L=yes
  9961. @@ -11506,6 +11525,16 @@ openbsd*)
  9962. fi
  9963. ;;
  9964. +hyperbolabsd*)
  9965. + version_type=sunos
  9966. + need_lib_prefix=no
  9967. + need_version=no
  9968. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  9969. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  9970. + shlibpath_var=LD_LIBRARY_PATH
  9971. + shlibpath_overrides_runpath=yes
  9972. + ;;
  9973. +
  9974. os2*)
  9975. libname_spec='$name'
  9976. shrext_cmds=".dll"
  9977. @@ -13484,6 +13513,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  9978. fi
  9979. ;;
  9980. + hyperbolabsd*)
  9981. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  9982. + hardcode_direct_CXX=yes
  9983. + hardcode_shlibpath_var_CXX=no
  9984. + hardcode_direct_absolute_CXX=yes
  9985. + archive_cmds_CXX='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  9986. + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
  9987. + else
  9988. + ld_shlibs_CXX=no
  9989. + fi
  9990. + ;;
  9991. +
  9992. osf3* | osf4* | osf5*)
  9993. case $cc_basename in
  9994. KCC*)
  9995. @@ -15166,6 +15207,16 @@ openbsd*)
  9996. fi
  9997. ;;
  9998. +hyperbolabsd*)
  9999. + version_type=sunos
  10000. + need_lib_prefix=no
  10001. + need_version=no
  10002. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  10003. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  10004. + shlibpath_var=LD_LIBRARY_PATH
  10005. + shlibpath_overrides_runpath=yes
  10006. + ;;
  10007. +
  10008. os2*)
  10009. libname_spec='$name'
  10010. shrext_cmds=".dll"
  10011. diff --git a/ltmain.sh b/ltmain.sh
  10012. index 9503ec8..304bd35 100644
  10013. --- a/ltmain.sh
  10014. +++ b/ltmain.sh
  10015. @@ -5,6 +5,10 @@
  10016. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
  10017. # 2007, 2008, 2009 Free Software Foundation, Inc.
  10018. +#
  10019. +# Modifications to support HyperbolaBSD:
  10020. +# Copyright (C) 2020-2024 Hyperbola Project
  10021. +#
  10022. # This is free software; see the source for copying conditions. There is NO
  10023. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10024. @@ -4741,7 +4745,7 @@ func_mode_link ()
  10025. # These systems don't actually have a C library (as such)
  10026. test "X$arg" = "X-lc" && continue
  10027. ;;
  10028. - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  10029. + *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly*)
  10030. # Do not include libc due to us having libc/libc_r.
  10031. test "X$arg" = "X-lc" && continue
  10032. ;;
  10033. @@ -4764,7 +4768,7 @@ func_mode_link ()
  10034. esac
  10035. elif test "X$arg" = "X-lc_r"; then
  10036. case $host in
  10037. - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  10038. + *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly*)
  10039. # Do not include libc_r directly, use -pthread flag.
  10040. continue
  10041. ;;
  10042. @@ -6703,7 +6707,7 @@ func_mode_link ()
  10043. *-*-netbsd*)
  10044. # Don't link with libc until the a.out ld.so is fixed.
  10045. ;;
  10046. - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  10047. + *-*-openbsd* | *-*-hyperbolabsd* | *-*-freebsd* | *-*-dragonfly*)
  10048. # Do not include libc due to us having libc/libc_r.
  10049. ;;
  10050. *-*-sco3.2v5* | *-*-sco5v6*)
  10051. diff --git a/lto-plugin/configure b/lto-plugin/configure
  10052. index 7843cd7..25d561b 100755
  10053. --- a/lto-plugin/configure
  10054. +++ b/lto-plugin/configure
  10055. @@ -6,6 +6,9 @@
  10056. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  10057. # Foundation, Inc.
  10058. #
  10059. +# Modifications to support HyperbolaBSD:
  10060. +# Copyright (C) 2020-2024 Hyperbola Project
  10061. +#
  10062. # This configure script is free software; the Free Software Foundation
  10063. # gives unlimited permission to copy, distribute and modify it.
  10064. ## -------------------- ##
  10065. @@ -6029,7 +6032,7 @@ else
  10066. lt_cv_sys_max_cmd_len=8192;
  10067. ;;
  10068. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  10069. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  10070. # This has been around since 386BSD, at least. Likely further.
  10071. if test -x /sbin/sysctl; then
  10072. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  10073. @@ -6467,6 +6470,10 @@ openbsd*)
  10074. fi
  10075. ;;
  10076. +hyperbolabsd*)
  10077. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  10078. + ;;
  10079. +
  10080. osf3* | osf4* | osf5*)
  10081. lt_cv_deplibs_check_method=pass_all
  10082. ;;
  10083. @@ -9334,6 +9341,11 @@ _LT_EOF
  10084. fi
  10085. ;;
  10086. + hyperbolabsd*)
  10087. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  10088. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  10089. + ;;
  10090. +
  10091. solaris*)
  10092. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  10093. ld_shlibs=no
  10094. @@ -9920,6 +9932,18 @@ rm -f core conftest.err conftest.$ac_objext \
  10095. fi
  10096. ;;
  10097. + hyperbolabsd*)
  10098. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  10099. + hardcode_direct=yes
  10100. + hardcode_shlibpath_var=no
  10101. + hardcode_direct_absolute=yes
  10102. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  10103. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  10104. + else
  10105. + ld_shlibs=no
  10106. + fi
  10107. + ;;
  10108. +
  10109. os2*)
  10110. hardcode_libdir_flag_spec='-L$libdir'
  10111. hardcode_minus_L=yes
  10112. @@ -10907,6 +10931,16 @@ openbsd*)
  10113. fi
  10114. ;;
  10115. +hyperbolabsd*)
  10116. + version_type=sunos
  10117. + need_lib_prefix=no
  10118. + need_version=no
  10119. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  10120. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  10121. + shlibpath_var=LD_LIBRARY_PATH
  10122. + shlibpath_overrides_runpath=yes
  10123. + ;;
  10124. +
  10125. os2*)
  10126. libname_spec='$name'
  10127. shrext_cmds=".dll"
  10128. diff --git a/zlib/configure b/zlib/configure
  10129. index ee5527c..432dd1a 100755
  10130. --- a/zlib/configure
  10131. +++ b/zlib/configure
  10132. @@ -6,6 +6,9 @@
  10133. # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
  10134. # Foundation, Inc.
  10135. #
  10136. +# Modifications to support HyperbolaBSD:
  10137. +# Copyright (C) 2020-2024 Hyperbola Project
  10138. +#
  10139. # This configure script is free software; the Free Software Foundation
  10140. # gives unlimited permission to copy, distribute and modify it.
  10141. ## -------------------- ##
  10142. @@ -4664,7 +4667,7 @@ else
  10143. lt_cv_sys_max_cmd_len=8192;
  10144. ;;
  10145. - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  10146. + netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | hyperbolabsd*)
  10147. # This has been around since 386BSD, at least. Likely further.
  10148. if test -x /sbin/sysctl; then
  10149. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  10150. @@ -5102,6 +5105,10 @@ openbsd*)
  10151. fi
  10152. ;;
  10153. +hyperbolabsd*)
  10154. + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  10155. + ;;
  10156. +
  10157. osf3* | osf4* | osf5*)
  10158. lt_cv_deplibs_check_method=pass_all
  10159. ;;
  10160. @@ -8244,6 +8251,11 @@ _LT_EOF
  10161. fi
  10162. ;;
  10163. + hyperbolabsd*)
  10164. + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  10165. + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  10166. + ;;
  10167. +
  10168. solaris*)
  10169. if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  10170. ld_shlibs=no
  10171. @@ -8839,6 +8851,18 @@ rm -f core conftest.err conftest.$ac_objext \
  10172. fi
  10173. ;;
  10174. + hyperbolabsd*)
  10175. + if test -f /usr/libexec/ld.so || test -f /libexec/ld.so; then
  10176. + hardcode_direct=yes
  10177. + hardcode_shlibpath_var=no
  10178. + hardcode_direct_absolute=yes
  10179. + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  10180. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  10181. + else
  10182. + ld_shlibs=no
  10183. + fi
  10184. + ;;
  10185. +
  10186. os2*)
  10187. hardcode_libdir_flag_spec='-L$libdir'
  10188. hardcode_minus_L=yes
  10189. @@ -9829,6 +9853,16 @@ openbsd*)
  10190. fi
  10191. ;;
  10192. +hyperbolabsd*)
  10193. + version_type=sunos
  10194. + need_lib_prefix=no
  10195. + need_version=no
  10196. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  10197. + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  10198. + shlibpath_var=LD_LIBRARY_PATH
  10199. + shlibpath_overrides_runpath=yes
  10200. + ;;
  10201. +
  10202. os2*)
  10203. libname_spec='$name'
  10204. shrext_cmds=".dll"