musl-git-20140319.patch 265 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864
  1. diff -Nur musl-0.9.15/arch/arm/bits/sem.h musl-git/arch/arm/bits/sem.h
  2. --- musl-0.9.15/arch/arm/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  3. +++ musl-git/arch/arm/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  4. @@ -0,0 +1,16 @@
  5. +struct semid_ds {
  6. + struct ipc_perm sem_perm;
  7. + time_t sem_otime;
  8. + time_t __unused1;
  9. + time_t sem_ctime;
  10. + time_t __unused2;
  11. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  12. + unsigned short sem_nsems;
  13. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  14. +#else
  15. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  16. + unsigned short sem_nsems;
  17. +#endif
  18. + time_t __unused3;
  19. + time_t __unused4;
  20. +};
  21. diff -Nur musl-0.9.15/arch/arm/bits/shm.h musl-git/arch/arm/bits/shm.h
  22. --- musl-0.9.15/arch/arm/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  23. +++ musl-git/arch/arm/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  24. @@ -16,3 +16,14 @@
  25. unsigned long __pad1;
  26. unsigned long __pad2;
  27. };
  28. +
  29. +struct shminfo {
  30. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  31. +};
  32. +
  33. +struct shm_info {
  34. + int __used_ids;
  35. + unsigned long shm_tot, shm_rss, shm_swp;
  36. + unsigned long __swap_attempts, __swap_successes;
  37. +};
  38. +
  39. diff -Nur musl-0.9.15/arch/arm/bits/signal.h musl-git/arch/arm/bits/signal.h
  40. --- musl-0.9.15/arch/arm/bits/signal.h 2014-01-03 21:12:17.000000000 +0100
  41. +++ musl-git/arch/arm/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  42. @@ -18,6 +18,12 @@
  43. } mcontext_t;
  44. #endif
  45. +struct sigaltstack {
  46. + void *ss_sp;
  47. + int ss_flags;
  48. + size_t ss_size;
  49. +};
  50. +
  51. typedef struct __ucontext {
  52. unsigned long uc_flags;
  53. struct __ucontext *uc_link;
  54. diff -Nur musl-0.9.15/arch/arm/bits/termios.h musl-git/arch/arm/bits/termios.h
  55. --- musl-0.9.15/arch/arm/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  56. +++ musl-git/arch/arm/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  57. @@ -42,6 +42,7 @@
  58. #define IXANY 0004000
  59. #define IXOFF 0010000
  60. #define IMAXBEL 0020000
  61. +#define IUTF8 0040000
  62. #define OPOST 0000001
  63. #define OLCUC 0000002
  64. @@ -75,9 +76,6 @@
  65. #define VT0 0000000
  66. #define VT1 0040000
  67. -/* ?? */
  68. -#define XTABS 0014000
  69. -
  70. #define B0 0000000
  71. #define B50 0000001
  72. #define B75 0000002
  73. @@ -125,8 +123,6 @@
  74. #define HUPCL 0002000
  75. #define CLOCAL 0004000
  76. -#define CRTSCTS 020000000000
  77. -
  78. #define ISIG 0000001
  79. #define ICANON 0000002
  80. #define ECHO 0000010
  81. @@ -137,14 +133,11 @@
  82. #define TOSTOP 0000400
  83. #define IEXTEN 0100000
  84. -/* Extensions? */
  85. -#define CBAUDEX 0010000
  86. #define ECHOCTL 0001000
  87. #define ECHOPRT 0002000
  88. #define ECHOKE 0004000
  89. #define FLUSHO 0010000
  90. #define PENDIN 0040000
  91. -#define EXTPROC 0200000
  92. #define TCOOFF 0
  93. #define TCOON 1
  94. @@ -158,3 +151,10 @@
  95. #define TCSANOW 0
  96. #define TCSADRAIN 1
  97. #define TCSAFLUSH 2
  98. +
  99. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  100. +#define CBAUDEX 0010000
  101. +#define CRTSCTS 020000000000
  102. +#define EXTPROC 0200000
  103. +#define XTABS 0014000
  104. +#endif
  105. diff -Nur musl-0.9.15/arch/arm/syscall_arch.h musl-git/arch/arm/syscall_arch.h
  106. --- musl-0.9.15/arch/arm/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  107. +++ musl-git/arch/arm/syscall_arch.h 2014-03-19 07:42:48.000000000 +0100
  108. @@ -3,6 +3,8 @@
  109. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  110. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  111. +long (__syscall)(long, ...);
  112. +
  113. #ifndef __clang__
  114. #define __asm_syscall(...) do { \
  115. diff -Nur musl-0.9.15/arch/i386/bits/sem.h musl-git/arch/i386/bits/sem.h
  116. --- musl-0.9.15/arch/i386/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  117. +++ musl-git/arch/i386/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  118. @@ -0,0 +1,16 @@
  119. +struct semid_ds {
  120. + struct ipc_perm sem_perm;
  121. + time_t sem_otime;
  122. + time_t __unused1;
  123. + time_t sem_ctime;
  124. + time_t __unused2;
  125. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  126. + unsigned short sem_nsems;
  127. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  128. +#else
  129. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  130. + unsigned short sem_nsems;
  131. +#endif
  132. + time_t __unused3;
  133. + time_t __unused4;
  134. +};
  135. diff -Nur musl-0.9.15/arch/i386/bits/shm.h musl-git/arch/i386/bits/shm.h
  136. --- musl-0.9.15/arch/i386/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  137. +++ musl-git/arch/i386/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  138. @@ -16,3 +16,14 @@
  139. unsigned long __pad1;
  140. unsigned long __pad2;
  141. };
  142. +
  143. +struct shminfo {
  144. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  145. +};
  146. +
  147. +struct shm_info {
  148. + int __used_ids;
  149. + unsigned long shm_tot, shm_rss, shm_swp;
  150. + unsigned long __swap_attempts, __swap_successes;
  151. +};
  152. +
  153. diff -Nur musl-0.9.15/arch/i386/bits/signal.h musl-git/arch/i386/bits/signal.h
  154. --- musl-0.9.15/arch/i386/bits/signal.h 2014-01-03 21:12:17.000000000 +0100
  155. +++ musl-git/arch/i386/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  156. @@ -53,6 +53,12 @@
  157. } mcontext_t;
  158. #endif
  159. +struct sigaltstack {
  160. + void *ss_sp;
  161. + int ss_flags;
  162. + size_t ss_size;
  163. +};
  164. +
  165. typedef struct __ucontext {
  166. unsigned long uc_flags;
  167. struct __ucontext *uc_link;
  168. diff -Nur musl-0.9.15/arch/i386/bits/termios.h musl-git/arch/i386/bits/termios.h
  169. --- musl-0.9.15/arch/i386/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  170. +++ musl-git/arch/i386/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  171. @@ -42,6 +42,7 @@
  172. #define IXANY 0004000
  173. #define IXOFF 0010000
  174. #define IMAXBEL 0020000
  175. +#define IUTF8 0040000
  176. #define OPOST 0000001
  177. #define OLCUC 0000002
  178. @@ -75,9 +76,6 @@
  179. #define VT0 0000000
  180. #define VT1 0040000
  181. -/* ?? */
  182. -#define XTABS 0014000
  183. -
  184. #define B0 0000000
  185. #define B50 0000001
  186. #define B75 0000002
  187. @@ -125,8 +123,6 @@
  188. #define HUPCL 0002000
  189. #define CLOCAL 0004000
  190. -#define CRTSCTS 020000000000
  191. -
  192. #define ISIG 0000001
  193. #define ICANON 0000002
  194. #define ECHO 0000010
  195. @@ -137,14 +133,11 @@
  196. #define TOSTOP 0000400
  197. #define IEXTEN 0100000
  198. -/* Extensions? */
  199. -#define CBAUDEX 0010000
  200. #define ECHOCTL 0001000
  201. #define ECHOPRT 0002000
  202. #define ECHOKE 0004000
  203. #define FLUSHO 0010000
  204. #define PENDIN 0040000
  205. -#define EXTPROC 0200000
  206. #define TCOOFF 0
  207. #define TCOON 1
  208. @@ -158,3 +151,10 @@
  209. #define TCSANOW 0
  210. #define TCSADRAIN 1
  211. #define TCSAFLUSH 2
  212. +
  213. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  214. +#define CBAUDEX 0010000
  215. +#define CRTSCTS 020000000000
  216. +#define EXTPROC 0200000
  217. +#define XTABS 0014000
  218. +#endif
  219. diff -Nur musl-0.9.15/arch/microblaze/bits/sem.h musl-git/arch/microblaze/bits/sem.h
  220. --- musl-0.9.15/arch/microblaze/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  221. +++ musl-git/arch/microblaze/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  222. @@ -0,0 +1,16 @@
  223. +struct semid_ds {
  224. + struct ipc_perm sem_perm;
  225. + time_t sem_otime;
  226. + time_t __unused1;
  227. + time_t sem_ctime;
  228. + time_t __unused2;
  229. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  230. + unsigned short sem_nsems;
  231. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  232. +#else
  233. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  234. + unsigned short sem_nsems;
  235. +#endif
  236. + time_t __unused3;
  237. + time_t __unused4;
  238. +};
  239. diff -Nur musl-0.9.15/arch/microblaze/bits/shm.h musl-git/arch/microblaze/bits/shm.h
  240. --- musl-0.9.15/arch/microblaze/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  241. +++ musl-git/arch/microblaze/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  242. @@ -16,3 +16,14 @@
  243. unsigned long __pad1;
  244. unsigned long __pad2;
  245. };
  246. +
  247. +struct shminfo {
  248. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  249. +};
  250. +
  251. +struct shm_info {
  252. + int __used_ids;
  253. + unsigned long shm_tot, shm_rss, shm_swp;
  254. + unsigned long __swap_attempts, __swap_successes;
  255. +};
  256. +
  257. diff -Nur musl-0.9.15/arch/microblaze/bits/signal.h musl-git/arch/microblaze/bits/signal.h
  258. --- musl-0.9.15/arch/microblaze/bits/signal.h 2014-01-03 21:12:17.000000000 +0100
  259. +++ musl-git/arch/microblaze/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  260. @@ -21,6 +21,12 @@
  261. } mcontext_t;
  262. #endif
  263. +struct sigaltstack {
  264. + void *ss_sp;
  265. + int ss_flags;
  266. + size_t ss_size;
  267. +};
  268. +
  269. typedef struct __ucontext {
  270. unsigned long uc_flags;
  271. struct __ucontext *uc_link;
  272. diff -Nur musl-0.9.15/arch/microblaze/bits/termios.h musl-git/arch/microblaze/bits/termios.h
  273. --- musl-0.9.15/arch/microblaze/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  274. +++ musl-git/arch/microblaze/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  275. @@ -42,6 +42,7 @@
  276. #define IXANY 0004000
  277. #define IXOFF 0010000
  278. #define IMAXBEL 0020000
  279. +#define IUTF8 0040000
  280. #define OPOST 0000001
  281. #define OLCUC 0000002
  282. @@ -75,9 +76,6 @@
  283. #define VT0 0000000
  284. #define VT1 0040000
  285. -/* ?? */
  286. -#define XTABS 0014000
  287. -
  288. #define B0 0000000
  289. #define B50 0000001
  290. #define B75 0000002
  291. @@ -125,8 +123,6 @@
  292. #define HUPCL 0002000
  293. #define CLOCAL 0004000
  294. -#define CRTSCTS 020000000000
  295. -
  296. #define ISIG 0000001
  297. #define ICANON 0000002
  298. #define ECHO 0000010
  299. @@ -137,14 +133,11 @@
  300. #define TOSTOP 0000400
  301. #define IEXTEN 0100000
  302. -/* Extensions? */
  303. -#define CBAUDEX 0010000
  304. #define ECHOCTL 0001000
  305. #define ECHOPRT 0002000
  306. #define ECHOKE 0004000
  307. #define FLUSHO 0010000
  308. #define PENDIN 0040000
  309. -#define EXTPROC 0200000
  310. #define TCOOFF 0
  311. #define TCOON 1
  312. @@ -158,3 +151,10 @@
  313. #define TCSANOW 0
  314. #define TCSADRAIN 1
  315. #define TCSAFLUSH 2
  316. +
  317. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  318. +#define CBAUDEX 0010000
  319. +#define CRTSCTS 020000000000
  320. +#define EXTPROC 0200000
  321. +#define XTABS 0014000
  322. +#endif
  323. diff -Nur musl-0.9.15/arch/microblaze/syscall_arch.h musl-git/arch/microblaze/syscall_arch.h
  324. --- musl-0.9.15/arch/microblaze/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  325. +++ musl-git/arch/microblaze/syscall_arch.h 2014-03-19 07:42:48.000000000 +0100
  326. @@ -3,6 +3,8 @@
  327. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  328. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  329. +long (__syscall)(long, ...);
  330. +
  331. #ifndef __clang__
  332. static __inline long __syscall0(long n)
  333. diff -Nur musl-0.9.15/arch/mips/bits/fenv.h musl-git/arch/mips/bits/fenv.h
  334. --- musl-0.9.15/arch/mips/bits/fenv.h 2014-01-03 21:12:17.000000000 +0100
  335. +++ musl-git/arch/mips/bits/fenv.h 2014-03-19 07:42:48.000000000 +0100
  336. @@ -1,3 +1,7 @@
  337. +#ifdef __mips_soft_float
  338. +#define FE_ALL_EXCEPT 0
  339. +#define FE_TONEAREST 0
  340. +#else
  341. #define FE_INEXACT 4
  342. #define FE_UNDERFLOW 8
  343. #define FE_OVERFLOW 16
  344. @@ -10,6 +14,7 @@
  345. #define FE_TOWARDZERO 1
  346. #define FE_UPWARD 2
  347. #define FE_DOWNWARD 3
  348. +#endif
  349. typedef unsigned short fexcept_t;
  350. diff -Nur musl-0.9.15/arch/mips/bits/sem.h musl-git/arch/mips/bits/sem.h
  351. --- musl-0.9.15/arch/mips/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  352. +++ musl-git/arch/mips/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  353. @@ -0,0 +1,14 @@
  354. +struct semid_ds {
  355. + struct ipc_perm sem_perm;
  356. + time_t sem_otime;
  357. + time_t sem_ctime;
  358. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  359. + unsigned short sem_nsems;
  360. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  361. +#else
  362. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  363. + unsigned short sem_nsems;
  364. +#endif
  365. + time_t __unused3;
  366. + time_t __unused4;
  367. +};
  368. diff -Nur musl-0.9.15/arch/mips/bits/setjmp.h musl-git/arch/mips/bits/setjmp.h
  369. --- musl-0.9.15/arch/mips/bits/setjmp.h 2014-01-03 21:12:17.000000000 +0100
  370. +++ musl-git/arch/mips/bits/setjmp.h 2014-03-19 07:42:48.000000000 +0100
  371. @@ -1 +1 @@
  372. -typedef unsigned long long __jmp_buf[15];
  373. +typedef unsigned long long __jmp_buf[13];
  374. diff -Nur musl-0.9.15/arch/mips/bits/shm.h musl-git/arch/mips/bits/shm.h
  375. --- musl-0.9.15/arch/mips/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  376. +++ musl-git/arch/mips/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  377. @@ -13,3 +13,14 @@
  378. unsigned long __pad1;
  379. unsigned long __pad2;
  380. };
  381. +
  382. +struct shminfo {
  383. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  384. +};
  385. +
  386. +struct shm_info {
  387. + int __used_ids;
  388. + unsigned long shm_tot, shm_rss, shm_swp;
  389. + unsigned long __swap_attempts, __swap_successes;
  390. +};
  391. +
  392. diff -Nur musl-0.9.15/arch/mips/bits/signal.h musl-git/arch/mips/bits/signal.h
  393. --- musl-0.9.15/arch/mips/bits/signal.h 2014-01-03 21:12:17.000000000 +0100
  394. +++ musl-git/arch/mips/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  395. @@ -38,13 +38,18 @@
  396. } mcontext_t;
  397. #endif
  398. +struct sigaltstack {
  399. + void *ss_sp;
  400. + size_t ss_size;
  401. + int ss_flags;
  402. +};
  403. +
  404. typedef struct __ucontext {
  405. unsigned long uc_flags;
  406. struct __ucontext *uc_link;
  407. stack_t uc_stack;
  408. mcontext_t uc_mcontext;
  409. sigset_t uc_sigmask;
  410. - unsigned long uc_regspace[128];
  411. } ucontext_t;
  412. #define SA_NOCLDSTOP 1
  413. diff -Nur musl-0.9.15/arch/mips/bits/statfs.h musl-git/arch/mips/bits/statfs.h
  414. --- musl-0.9.15/arch/mips/bits/statfs.h 2014-01-03 21:12:17.000000000 +0100
  415. +++ musl-git/arch/mips/bits/statfs.h 2014-03-19 07:42:48.000000000 +0100
  416. @@ -1,7 +1,8 @@
  417. struct statfs {
  418. - unsigned long f_type, f_bsize;
  419. - fsblkcnt_t f_blocks, f_bfree, f_bavail;
  420. + unsigned long f_type, f_bsize, f_frsize;
  421. + fsblkcnt_t f_blocks, f_bfree;
  422. fsfilcnt_t f_files, f_ffree;
  423. + fsblkcnt_t f_bavail;
  424. fsid_t f_fsid;
  425. - unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
  426. + unsigned long f_namelen, f_flags, f_spare[5];
  427. };
  428. diff -Nur musl-0.9.15/arch/mips/bits/termios.h musl-git/arch/mips/bits/termios.h
  429. --- musl-0.9.15/arch/mips/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  430. +++ musl-git/arch/mips/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  431. @@ -77,9 +77,6 @@
  432. #define VT0 0000000
  433. #define VT1 0040000
  434. -/* ?? */
  435. -#define XTABS 0014000
  436. -
  437. #define B0 0000000
  438. #define B50 0000001
  439. #define B75 0000002
  440. @@ -129,12 +126,6 @@
  441. #define PARODD 0001000
  442. #define HUPCL 0002000
  443. #define CLOCAL 0004000
  444. -#define CBAUDEX 0010000
  445. -
  446. -#define CIBAUD 002003600000
  447. -#define CMSPAR 010000000000
  448. -#define CRTSCTS 020000000000
  449. -#define IBSHIFT 16
  450. #define ISIG 0000001
  451. #define ICANON 0000002
  452. @@ -152,9 +143,6 @@
  453. #define PENDIN 0040000
  454. #define TOSTOP 0100000
  455. #define ITOSTOP 0100000
  456. -#define EXTPROC 0200000
  457. -
  458. -#define TIOCSER_TEMT 1
  459. #define TCOOFF 0
  460. #define TCOON 1
  461. @@ -168,3 +156,14 @@
  462. #define TCSANOW 0
  463. #define TCSADRAIN 1
  464. #define TCSAFLUSH 2
  465. +
  466. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  467. +#define CBAUDEX 0010000
  468. +#define CIBAUD 002003600000
  469. +#define IBSHIFT 16
  470. +#define CMSPAR 010000000000
  471. +#define CRTSCTS 020000000000
  472. +#define EXTPROC 0200000
  473. +#define XTABS 0014000
  474. +#define TIOCSER_TEMT 1
  475. +#endif
  476. diff -Nur musl-0.9.15/arch/mips/reloc.h musl-git/arch/mips/reloc.h
  477. --- musl-0.9.15/arch/mips/reloc.h 2014-01-03 21:12:17.000000000 +0100
  478. +++ musl-git/arch/mips/reloc.h 2014-03-19 07:42:48.000000000 +0100
  479. @@ -8,7 +8,13 @@
  480. #define ENDIAN_SUFFIX ""
  481. #endif
  482. -#define LDSO_ARCH "mips" ENDIAN_SUFFIX
  483. +#ifdef __mips_soft_float
  484. +#define FP_SUFFIX "-sf"
  485. +#else
  486. +#define FP_SUFFIX ""
  487. +#endif
  488. +
  489. +#define LDSO_ARCH "mips" ENDIAN_SUFFIX FP_SUFFIX
  490. #define IS_COPY(x) ((x)==R_MIPS_COPY)
  491. #define IS_PLT(x) 1
  492. diff -Nur musl-0.9.15/arch/mips/syscall_arch.h musl-git/arch/mips/syscall_arch.h
  493. --- musl-0.9.15/arch/mips/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  494. +++ musl-git/arch/mips/syscall_arch.h 2014-03-19 07:42:48.000000000 +0100
  495. @@ -3,6 +3,8 @@
  496. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  497. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  498. +long (__syscall)(long, ...);
  499. +
  500. #ifndef __clang__
  501. #define __asm_syscall(...) do { \
  502. diff -Nur musl-0.9.15/arch/powerpc/bits/ipc.h musl-git/arch/powerpc/bits/ipc.h
  503. --- musl-0.9.15/arch/powerpc/bits/ipc.h 2014-01-03 21:12:17.000000000 +0100
  504. +++ musl-git/arch/powerpc/bits/ipc.h 2014-03-19 07:42:48.000000000 +0100
  505. @@ -7,8 +7,9 @@
  506. gid_t cgid;
  507. mode_t mode;
  508. int __ipc_perm_seq;
  509. - long __pad1;
  510. - long __pad2;
  511. + int __pad1;
  512. + long long __pad2;
  513. + long long __pad3;
  514. };
  515. #define IPC_64 0x100
  516. diff -Nur musl-0.9.15/arch/powerpc/bits/msg.h musl-git/arch/powerpc/bits/msg.h
  517. --- musl-0.9.15/arch/powerpc/bits/msg.h 2014-01-03 21:12:17.000000000 +0100
  518. +++ musl-git/arch/powerpc/bits/msg.h 2014-03-19 07:42:48.000000000 +0100
  519. @@ -1,12 +1,12 @@
  520. struct msqid_ds
  521. {
  522. struct ipc_perm msg_perm;
  523. - time_t msg_stime;
  524. int __unused1;
  525. - time_t msg_rtime;
  526. + time_t msg_stime;
  527. int __unused2;
  528. - time_t msg_ctime;
  529. + time_t msg_rtime;
  530. int __unused3;
  531. + time_t msg_ctime;
  532. unsigned long msg_cbytes;
  533. msgqnum_t msg_qnum;
  534. msglen_t msg_qbytes;
  535. diff -Nur musl-0.9.15/arch/powerpc/bits/sem.h musl-git/arch/powerpc/bits/sem.h
  536. --- musl-0.9.15/arch/powerpc/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  537. +++ musl-git/arch/powerpc/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  538. @@ -0,0 +1,10 @@
  539. +struct semid_ds {
  540. + struct ipc_perm sem_perm;
  541. + int __unused1;
  542. + time_t sem_otime;
  543. + int __unused2;
  544. + time_t sem_ctime;
  545. + unsigned short __sem_nsems_pad, sem_nsems;
  546. + long __unused3;
  547. + long __unused4;
  548. +};
  549. diff -Nur musl-0.9.15/arch/powerpc/bits/shm.h musl-git/arch/powerpc/bits/shm.h
  550. --- musl-0.9.15/arch/powerpc/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  551. +++ musl-git/arch/powerpc/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  552. @@ -3,16 +3,28 @@
  553. struct shmid_ds
  554. {
  555. struct ipc_perm shm_perm;
  556. - size_t shm_segsz;
  557. - time_t shm_atime;
  558. int __unused1;
  559. - time_t shm_dtime;
  560. + time_t shm_atime;
  561. int __unused2;
  562. - time_t shm_ctime;
  563. + time_t shm_dtime;
  564. int __unused3;
  565. + time_t shm_ctime;
  566. + int __unused4;
  567. + size_t shm_segsz;
  568. pid_t shm_cpid;
  569. pid_t shm_lpid;
  570. unsigned long shm_nattch;
  571. unsigned long __pad1;
  572. unsigned long __pad2;
  573. };
  574. +
  575. +struct shminfo {
  576. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  577. +};
  578. +
  579. +struct shm_info {
  580. + int __used_ids;
  581. + unsigned long shm_tot, shm_rss, shm_swp;
  582. + unsigned long __swap_attempts, __swap_successes;
  583. +};
  584. +
  585. diff -Nur musl-0.9.15/arch/powerpc/bits/signal.h musl-git/arch/powerpc/bits/signal.h
  586. --- musl-0.9.15/arch/powerpc/bits/signal.h 2014-01-03 21:12:17.000000000 +0100
  587. +++ musl-git/arch/powerpc/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  588. @@ -49,6 +49,12 @@
  589. #endif
  590. +struct sigaltstack {
  591. + void *ss_sp;
  592. + int ss_flags;
  593. + size_t ss_size;
  594. +};
  595. +
  596. typedef struct __ucontext {
  597. unsigned long uc_flags;
  598. struct __ucontext *uc_link;
  599. diff -Nur musl-0.9.15/arch/powerpc/bits/socket.h musl-git/arch/powerpc/bits/socket.h
  600. --- musl-0.9.15/arch/powerpc/bits/socket.h 2014-01-03 21:12:17.000000000 +0100
  601. +++ musl-git/arch/powerpc/bits/socket.h 2014-03-19 07:42:48.000000000 +0100
  602. @@ -1,12 +1,12 @@
  603. struct msghdr
  604. {
  605. void *msg_name;
  606. - int msg_namelen;
  607. + socklen_t msg_namelen;
  608. struct iovec *msg_iov;
  609. - unsigned long msg_iovlen;
  610. + int msg_iovlen;
  611. void *msg_control;
  612. - unsigned long msg_controllen;
  613. - unsigned msg_flags;
  614. + socklen_t msg_controllen;
  615. + int msg_flags;
  616. };
  617. struct cmsghdr
  618. diff -Nur musl-0.9.15/arch/powerpc/bits/termios.h musl-git/arch/powerpc/bits/termios.h
  619. --- musl-0.9.15/arch/powerpc/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  620. +++ musl-git/arch/powerpc/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  621. @@ -66,7 +66,6 @@
  622. #define TAB1 00002000
  623. #define TAB2 00004000
  624. #define TAB3 00006000
  625. -#define XTABS 00006000
  626. #define CRDLY 00030000
  627. #define CR0 00000000
  628. #define CR1 00010000
  629. @@ -101,7 +100,6 @@
  630. #define B38400 0000017
  631. #define EXTA B19200
  632. #define EXTB B38400
  633. -#define CBAUDEX 0000000
  634. #define B57600 00020
  635. #define B115200 00021
  636. #define B230400 00022
  637. @@ -120,9 +118,6 @@
  638. #define B4000000 00036
  639. #define BOTHER 00037
  640. -#define CIBAUD 077600000
  641. -#define IBSHIFT 16
  642. -
  643. #define CSIZE 00001400
  644. #define CS5 00000000
  645. #define CS6 00000400
  646. @@ -136,8 +131,6 @@
  647. #define HUPCL 00040000
  648. #define CLOCAL 00100000
  649. -#define CMSPAR 010000000000
  650. -#define CRTSCTS 020000000000
  651. #define ISIG 0x00000080
  652. #define ICANON 0x00000100
  653. @@ -154,7 +147,6 @@
  654. #define FLUSHO 0x00800000
  655. #define PENDIN 0x20000000
  656. #define IEXTEN 0x00000400
  657. -#define EXTPROC 0x10000000
  658. #define TCOOFF 0
  659. #define TCOON 1
  660. @@ -168,3 +160,13 @@
  661. #define TCSANOW 0
  662. #define TCSADRAIN 1
  663. #define TCSAFLUSH 2
  664. +
  665. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  666. +#define CBAUDEX 0000000
  667. +#define CIBAUD 077600000
  668. +#define IBSHIFT 16
  669. +#define CMSPAR 010000000000
  670. +#define CRTSCTS 020000000000
  671. +#define EXTPROC 0x10000000
  672. +#define XTABS 00006000
  673. +#endif
  674. diff -Nur musl-0.9.15/arch/sh/atomic.h musl-git/arch/sh/atomic.h
  675. --- musl-0.9.15/arch/sh/atomic.h 1970-01-01 01:00:00.000000000 +0100
  676. +++ musl-git/arch/sh/atomic.h 2014-03-19 07:42:48.000000000 +0100
  677. @@ -0,0 +1,87 @@
  678. +#ifndef _INTERNAL_ATOMIC_H
  679. +#define _INTERNAL_ATOMIC_H
  680. +
  681. +#include <stdint.h>
  682. +
  683. +static inline int a_ctz_l(unsigned long x)
  684. +{
  685. + static const char debruijn32[32] = {
  686. + 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13,
  687. + 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14
  688. + };
  689. + return debruijn32[(x&-x)*0x076be629 >> 27];
  690. +}
  691. +
  692. +static inline int a_ctz_64(uint64_t x)
  693. +{
  694. + uint32_t y = x;
  695. + if (!y) {
  696. + y = x>>32;
  697. + return 32 + a_ctz_l(y);
  698. + }
  699. + return a_ctz_l(y);
  700. +}
  701. +
  702. +int __sh_cas(volatile int *, int, int);
  703. +int __sh_swap(volatile int *, int);
  704. +int __sh_fetch_add(volatile int *, int);
  705. +void __sh_store(volatile int *, int);
  706. +void __sh_and(volatile int *, int);
  707. +void __sh_or(volatile int *, int);
  708. +
  709. +#define a_cas(p,t,s) __sh_cas(p,t,s)
  710. +#define a_swap(x,v) __sh_swap(x,v)
  711. +#define a_fetch_add(x,v) __sh_fetch_add(x, v)
  712. +#define a_store(x,v) __sh_store(x, v)
  713. +#define a_and(x,v) __sh_and(x, v)
  714. +#define a_or(x,v) __sh_or(x, v)
  715. +
  716. +static inline void *a_cas_p(volatile void *p, void *t, void *s)
  717. +{
  718. + return (void *)a_cas(p, (int)t, (int)s);
  719. +}
  720. +
  721. +static inline long a_cas_l(volatile void *p, long t, long s)
  722. +{
  723. + return a_cas(p, t, s);
  724. +}
  725. +
  726. +static inline void a_inc(volatile int *x)
  727. +{
  728. + a_fetch_add(x, 1);
  729. +}
  730. +
  731. +static inline void a_dec(volatile int *x)
  732. +{
  733. + a_fetch_add(x, -1);
  734. +}
  735. +
  736. +static inline void a_spin()
  737. +{
  738. +}
  739. +
  740. +static inline void a_crash()
  741. +{
  742. + *(volatile char *)0=0;
  743. +}
  744. +
  745. +static inline void a_or_l(volatile void *p, long v)
  746. +{
  747. + a_or(p, v);
  748. +}
  749. +
  750. +static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  751. +{
  752. + union { uint64_t v; uint32_t r[2]; } u = { v };
  753. + a_and((int *)p, u.r[0]);
  754. + a_and((int *)p+1, u.r[1]);
  755. +}
  756. +
  757. +static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  758. +{
  759. + union { uint64_t v; uint32_t r[2]; } u = { v };
  760. + a_or((int *)p, u.r[0]);
  761. + a_or((int *)p+1, u.r[1]);
  762. +}
  763. +
  764. +#endif
  765. diff -Nur musl-0.9.15/arch/sh/bits/alltypes.h.in musl-git/arch/sh/bits/alltypes.h.in
  766. --- musl-0.9.15/arch/sh/bits/alltypes.h.in 1970-01-01 01:00:00.000000000 +0100
  767. +++ musl-git/arch/sh/bits/alltypes.h.in 2014-03-19 07:42:48.000000000 +0100
  768. @@ -0,0 +1,23 @@
  769. +#define _Addr int
  770. +#define _Int64 long long
  771. +#define _Reg int
  772. +
  773. +TYPEDEF __builtin_va_list va_list;
  774. +TYPEDEF __builtin_va_list __isoc_va_list;
  775. +
  776. +#ifndef __cplusplus
  777. +TYPEDEF long wchar_t;
  778. +#endif
  779. +TYPEDEF unsigned wint_t;
  780. +
  781. +TYPEDEF float float_t;
  782. +TYPEDEF double double_t;
  783. +
  784. +TYPEDEF long time_t;
  785. +TYPEDEF long suseconds_t;
  786. +
  787. +TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
  788. +TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
  789. +TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
  790. +TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
  791. +TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
  792. diff -Nur musl-0.9.15/arch/sh/bits/endian.h musl-git/arch/sh/bits/endian.h
  793. --- musl-0.9.15/arch/sh/bits/endian.h 1970-01-01 01:00:00.000000000 +0100
  794. +++ musl-git/arch/sh/bits/endian.h 2014-03-19 07:42:48.000000000 +0100
  795. @@ -0,0 +1,5 @@
  796. +#if __BIG_ENDIAN__
  797. +#define __BYTE_ORDER __BIG_ENDIAN
  798. +#else
  799. +#define __BYTE_ORDER __LITTLE_ENDIAN
  800. +#endif
  801. diff -Nur musl-0.9.15/arch/sh/bits/errno.h musl-git/arch/sh/bits/errno.h
  802. --- musl-0.9.15/arch/sh/bits/errno.h 1970-01-01 01:00:00.000000000 +0100
  803. +++ musl-git/arch/sh/bits/errno.h 2014-03-19 07:42:48.000000000 +0100
  804. @@ -0,0 +1,134 @@
  805. +#define EPERM 1
  806. +#define ENOENT 2
  807. +#define ESRCH 3
  808. +#define EINTR 4
  809. +#define EIO 5
  810. +#define ENXIO 6
  811. +#define E2BIG 7
  812. +#define ENOEXEC 8
  813. +#define EBADF 9
  814. +#define ECHILD 10
  815. +#define EAGAIN 11
  816. +#define ENOMEM 12
  817. +#define EACCES 13
  818. +#define EFAULT 14
  819. +#define ENOTBLK 15
  820. +#define EBUSY 16
  821. +#define EEXIST 17
  822. +#define EXDEV 18
  823. +#define ENODEV 19
  824. +#define ENOTDIR 20
  825. +#define EISDIR 21
  826. +#define EINVAL 22
  827. +#define ENFILE 23
  828. +#define EMFILE 24
  829. +#define ENOTTY 25
  830. +#define ETXTBSY 26
  831. +#define EFBIG 27
  832. +#define ENOSPC 28
  833. +#define ESPIPE 29
  834. +#define EROFS 30
  835. +#define EMLINK 31
  836. +#define EPIPE 32
  837. +#define EDOM 33
  838. +#define ERANGE 34
  839. +#define EDEADLK 35
  840. +#define ENAMETOOLONG 36
  841. +#define ENOLCK 37
  842. +#define ENOSYS 38
  843. +#define ENOTEMPTY 39
  844. +#define ELOOP 40
  845. +#define EWOULDBLOCK EAGAIN
  846. +#define ENOMSG 42
  847. +#define EIDRM 43
  848. +#define ECHRNG 44
  849. +#define EL2NSYNC 45
  850. +#define EL3HLT 46
  851. +#define EL3RST 47
  852. +#define ELNRNG 48
  853. +#define EUNATCH 49
  854. +#define ENOCSI 50
  855. +#define EL2HLT 51
  856. +#define EBADE 52
  857. +#define EBADR 53
  858. +#define EXFULL 54
  859. +#define ENOANO 55
  860. +#define EBADRQC 56
  861. +#define EBADSLT 57
  862. +#define EDEADLOCK EDEADLK
  863. +#define EBFONT 59
  864. +#define ENOSTR 60
  865. +#define ENODATA 61
  866. +#define ETIME 62
  867. +#define ENOSR 63
  868. +#define ENONET 64
  869. +#define ENOPKG 65
  870. +#define EREMOTE 66
  871. +#define ENOLINK 67
  872. +#define EADV 68
  873. +#define ESRMNT 69
  874. +#define ECOMM 70
  875. +#define EPROTO 71
  876. +#define EMULTIHOP 72
  877. +#define EDOTDOT 73
  878. +#define EBADMSG 74
  879. +#define EOVERFLOW 75
  880. +#define ENOTUNIQ 76
  881. +#define EBADFD 77
  882. +#define EREMCHG 78
  883. +#define ELIBACC 79
  884. +#define ELIBBAD 80
  885. +#define ELIBSCN 81
  886. +#define ELIBMAX 82
  887. +#define ELIBEXEC 83
  888. +#define EILSEQ 84
  889. +#define ERESTART 85
  890. +#define ESTRPIPE 86
  891. +#define EUSERS 87
  892. +#define ENOTSOCK 88
  893. +#define EDESTADDRREQ 89
  894. +#define EMSGSIZE 90
  895. +#define EPROTOTYPE 91
  896. +#define ENOPROTOOPT 92
  897. +#define EPROTONOSUPPORT 93
  898. +#define ESOCKTNOSUPPORT 94
  899. +#define EOPNOTSUPP 95
  900. +#define ENOTSUP EOPNOTSUPP
  901. +#define EPFNOSUPPORT 96
  902. +#define EAFNOSUPPORT 97
  903. +#define EADDRINUSE 98
  904. +#define EADDRNOTAVAIL 99
  905. +#define ENETDOWN 100
  906. +#define ENETUNREACH 101
  907. +#define ENETRESET 102
  908. +#define ECONNABORTED 103
  909. +#define ECONNRESET 104
  910. +#define ENOBUFS 105
  911. +#define EISCONN 106
  912. +#define ENOTCONN 107
  913. +#define ESHUTDOWN 108
  914. +#define ETOOMANYREFS 109
  915. +#define ETIMEDOUT 110
  916. +#define ECONNREFUSED 111
  917. +#define EHOSTDOWN 112
  918. +#define EHOSTUNREACH 113
  919. +#define EALREADY 114
  920. +#define EINPROGRESS 115
  921. +#define ESTALE 116
  922. +#define EUCLEAN 117
  923. +#define ENOTNAM 118
  924. +#define ENAVAIL 119
  925. +#define EISNAM 120
  926. +#define EREMOTEIO 121
  927. +#define EDQUOT 122
  928. +#define ENOMEDIUM 123
  929. +#define EMEDIUMTYPE 124
  930. +#define ECANCELED 125
  931. +#define ENOKEY 126
  932. +#define EKEYEXPIRED 127
  933. +#define EKEYREVOKED 128
  934. +#define EKEYREJECTED 129
  935. +#define EOWNERDEAD 130
  936. +#define ENOTRECOVERABLE 131
  937. +#define ERFKILL 132
  938. +#define EHWPOISON 133
  939. diff -Nur musl-0.9.15/arch/sh/bits/fcntl.h musl-git/arch/sh/bits/fcntl.h
  940. --- musl-0.9.15/arch/sh/bits/fcntl.h 1970-01-01 01:00:00.000000000 +0100
  941. +++ musl-git/arch/sh/bits/fcntl.h 2014-03-19 07:42:48.000000000 +0100
  942. @@ -0,0 +1,39 @@
  943. +#define O_CREAT 0100
  944. +#define O_EXCL 0200
  945. +#define O_NOCTTY 0400
  946. +#define O_TRUNC 01000
  947. +#define O_APPEND 02000
  948. +#define O_NONBLOCK 04000
  949. +#define O_DSYNC 010000
  950. +#define O_SYNC 04010000
  951. +#define O_RSYNC 04010000
  952. +#define O_DIRECTORY 0200000
  953. +#define O_NOFOLLOW 0400000
  954. +#define O_CLOEXEC 02000000
  955. +
  956. +#define O_ASYNC 020000
  957. +#define O_DIRECT 040000
  958. +#define O_LARGEFILE 0100000
  959. +#define O_NOATIME 01000000
  960. +#define O_TMPFILE 020200000
  961. +#define O_NDELAY O_NONBLOCK
  962. +
  963. +#define F_DUPFD 0
  964. +#define F_GETFD 1
  965. +#define F_SETFD 2
  966. +#define F_GETFL 3
  967. +#define F_SETFL 4
  968. +
  969. +#define F_SETOWN 8
  970. +#define F_GETOWN 9
  971. +#define F_SETSIG 10
  972. +#define F_GETSIG 11
  973. +
  974. +#define F_GETLK 12
  975. +#define F_SETLK 13
  976. +#define F_SETLKW 14
  977. +
  978. +#define F_SETOWN_EX 15
  979. +#define F_GETOWN_EX 16
  980. +
  981. +#define F_GETOWNER_UIDS 17
  982. diff -Nur musl-0.9.15/arch/sh/bits/fenv.h musl-git/arch/sh/bits/fenv.h
  983. --- musl-0.9.15/arch/sh/bits/fenv.h 1970-01-01 01:00:00.000000000 +0100
  984. +++ musl-git/arch/sh/bits/fenv.h 2014-03-19 07:42:48.000000000 +0100
  985. @@ -0,0 +1,26 @@
  986. +#ifndef __SH_FPU_ANY__
  987. +
  988. +#define FE_ALL_EXCEPT 0
  989. +#define FE_TONEAREST 0
  990. +
  991. +#else
  992. +
  993. +#define FE_TONEAREST 0
  994. +#define FE_TOWARDZERO 1
  995. +
  996. +#define FE_INEXACT 0x04
  997. +#define FE_UNDERFLOW 0x08
  998. +#define FE_OVERFLOW 0x10
  999. +#define FE_DIVBYZERO 0x20
  1000. +#define FE_INVALID 0x40
  1001. +#define FE_ALL_EXCEPT 0x7c
  1002. +
  1003. +#endif
  1004. +
  1005. +typedef unsigned long fexcept_t;
  1006. +
  1007. +typedef struct {
  1008. + unsigned long __cw;
  1009. +} fenv_t;
  1010. +
  1011. +#define FE_DFL_ENV ((const fenv_t *) -1)
  1012. diff -Nur musl-0.9.15/arch/sh/bits/float.h musl-git/arch/sh/bits/float.h
  1013. --- musl-0.9.15/arch/sh/bits/float.h 1970-01-01 01:00:00.000000000 +0100
  1014. +++ musl-git/arch/sh/bits/float.h 2014-03-19 07:42:48.000000000 +0100
  1015. @@ -0,0 +1,17 @@
  1016. +#define FLT_ROUNDS 1
  1017. +#define FLT_EVAL_METHOD 0
  1018. +
  1019. +#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
  1020. +#define LDBL_MIN 2.22507385850720138309e-308L
  1021. +#define LDBL_MAX 1.79769313486231570815e+308L
  1022. +#define LDBL_EPSILON 2.22044604925031308085e-16L
  1023. +
  1024. +#define LDBL_MANT_DIG 53
  1025. +#define LDBL_MIN_EXP (-1021)
  1026. +#define LDBL_MAX_EXP 1024
  1027. +
  1028. +#define LDBL_DIG 15
  1029. +#define LDBL_MIN_10_EXP (-307)
  1030. +#define LDBL_MAX_10_EXP 308
  1031. +
  1032. +#define DECIMAL_DIG 17
  1033. diff -Nur musl-0.9.15/arch/sh/bits/ioctl.h musl-git/arch/sh/bits/ioctl.h
  1034. --- musl-0.9.15/arch/sh/bits/ioctl.h 1970-01-01 01:00:00.000000000 +0100
  1035. +++ musl-git/arch/sh/bits/ioctl.h 2014-03-19 07:42:48.000000000 +0100
  1036. @@ -0,0 +1,205 @@
  1037. +#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
  1038. +#define _IOC_NONE 0U
  1039. +#define _IOC_WRITE 1U
  1040. +#define _IOC_READ 2U
  1041. +
  1042. +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
  1043. +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
  1044. +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
  1045. +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
  1046. +
  1047. +#define FIOCLEX _IO('f', 1)
  1048. +#define FIONCLEX _IO('f', 2)
  1049. +#define FIOASYNC _IOW('f', 125, int)
  1050. +#define FIONBIO _IOW('f', 126, int)
  1051. +#define FIONREAD _IOR('f', 127, int)
  1052. +#define TIOCINQ FIONREAD
  1053. +#define FIOQSIZE _IOR('f', 128, char[8])
  1054. +
  1055. +#define TCGETA _IOR('t', 23, char[18])
  1056. +#define TCSETA _IOW('t', 24, char[18])
  1057. +#define TCSETAW _IOW('t', 25, char[18])
  1058. +#define TCSETAF _IOW('t', 28, char[18])
  1059. +
  1060. +#define TCSBRK _IO('t', 29)
  1061. +#define TCXONC _IO('t', 30)
  1062. +#define TCFLSH _IO('t', 31)
  1063. +
  1064. +#define TIOCSWINSZ _IOW('t', 103, char[8])
  1065. +#define TIOCGWINSZ _IOR('t', 104, char[8])
  1066. +#define TIOCSTART _IO('t', 110)
  1067. +#define TIOCSTOP _IO('t', 111)
  1068. +#define TIOCOUTQ _IOR('t', 115, int)
  1069. +
  1070. +#define TIOCSPGRP _IOW('t', 118, int)
  1071. +#define TIOCGPGRP _IOR('t', 119, int)
  1072. +
  1073. +#define TIOCEXCL _IO('T', 12)
  1074. +#define TIOCNXCL _IO('T', 13)
  1075. +#define TIOCSCTTY _IO('T', 14)
  1076. +
  1077. +#define TIOCSTI _IOW('T', 18, char)
  1078. +#define TIOCMGET _IOR('T', 21, unsigned int)
  1079. +#define TIOCMBIS _IOW('T', 22, unsigned int)
  1080. +#define TIOCMBIC _IOW('T', 23, unsigned int)
  1081. +#define TIOCMSET _IOW('T', 24, unsigned int)
  1082. +#define TIOCM_LE 0x001
  1083. +#define TIOCM_DTR 0x002
  1084. +#define TIOCM_RTS 0x004
  1085. +#define TIOCM_ST 0x008
  1086. +#define TIOCM_SR 0x010
  1087. +#define TIOCM_CTS 0x020
  1088. +#define TIOCM_CAR 0x040
  1089. +#define TIOCM_RNG 0x080
  1090. +#define TIOCM_DSR 0x100
  1091. +#define TIOCM_CD TIOCM_CAR
  1092. +#define TIOCM_RI TIOCM_RNG
  1093. +#define TIOCM_OUT1 0x2000
  1094. +#define TIOCM_OUT2 0x4000
  1095. +#define TIOCM_LOOP 0x8000
  1096. +
  1097. +#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
  1098. +#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
  1099. +#define TIOCLINUX _IOW('T', 28, char)
  1100. +#define TIOCCONS _IO('T', 29)
  1101. +#define TIOCGSERIAL _IOR('T', 30, char[60])
  1102. +#define TIOCSSERIAL _IOW('T', 31, char[60])
  1103. +#define TIOCPKT _IOW('T', 32, int)
  1104. +#define TIOCPKT_DATA 0
  1105. +#define TIOCPKT_FLUSHREAD 1
  1106. +#define TIOCPKT_FLUSHWRITE 2
  1107. +#define TIOCPKT_STOP 4
  1108. +#define TIOCPKT_START 8
  1109. +#define TIOCPKT_NOSTOP 16
  1110. +#define TIOCPKT_DOSTOP 32
  1111. +#define TIOCPKT_IOCTL 64
  1112. +
  1113. +#define TIOCNOTTY _IO('T', 34)
  1114. +#define TIOCSETD _IOW('T', 35, int)
  1115. +#define TIOCGETD _IOR('T', 36, int)
  1116. +#define TCSBRKP _IOW('T', 37, int)
  1117. +#define TIOCSBRK _IO('T', 39)
  1118. +#define TIOCCBRK _IO('T', 40)
  1119. +#define TIOCGSID _IOR('T', 41, int)
  1120. +#define TCGETS _IOR('T', 42, char[44])
  1121. +#define TCSETS _IOW('T', 43, char[44])
  1122. +#define TCSETSW _IOW('T', 44, char[44])
  1123. +#define TCSETSF _IOW('T', 45, char[44])
  1124. +#define TIOCGPTN _IOR('T', 48, unsigned int)
  1125. +#define TIOCSPTLCK _IOW('T', 49, int)
  1126. +#define TIOCGDEV _IOR('T', 50, unsigned int)
  1127. +#define TIOCSIG _IOW('T', 54, int)
  1128. +#define TIOCVHANGUP _IO('T', 55)
  1129. +#define TIOCGPKT _IOR('T', 56, int)
  1130. +#define TIOCGPTLCK _IOR('T', 57, int)
  1131. +#define TIOCGEXCL _IOR('T', 64, int)
  1132. +
  1133. +#define TIOCSERCONFIG _IO('T', 83)
  1134. +#define TIOCSERGWILD _IOR('T', 84, int)
  1135. +#define TIOCSERSWILD _IOW('T', 85, int)
  1136. +#define TIOCGLCKTRMIOS _IO('T', 86)
  1137. +#define TIOCSLCKTRMIOS _IO('T', 87)
  1138. +#define TIOCSERGSTRUCT _IOR('T', 88, char[216])
  1139. +#define TIOCSERGETLSR _IOR('T', 89, unsigned int)
  1140. +#define TIOCSER_TEMT 0x01
  1141. +#define TIOCSERGETMULTI _IOR('T', 90, char[168])
  1142. +#define TIOCSERSETMULTI _IOW('T', 91, char[168])
  1143. +
  1144. +#define TIOCMIWAIT _IO('T', 92)
  1145. +#define TIOCGICOUNT _IO('T', 93)
  1146. +
  1147. +struct winsize {
  1148. + unsigned short ws_row;
  1149. + unsigned short ws_col;
  1150. + unsigned short ws_xpixel;
  1151. + unsigned short ws_ypixel;
  1152. +};
  1153. +
  1154. +#define TIOCM_MODEM_BITS TIOCM_OUT2
  1155. +
  1156. +#define N_TTY 0
  1157. +#define N_SLIP 1
  1158. +#define N_MOUSE 2
  1159. +#define N_PPP 3
  1160. +#define N_STRIP 4
  1161. +#define N_AX25 5
  1162. +#define N_X25 6
  1163. +#define N_6PACK 7
  1164. +#define N_MASC 8
  1165. +#define N_R3964 9
  1166. +#define N_PROFIBUS_FDL 10
  1167. +#define N_IRDA 11
  1168. +#define N_SMSBLOCK 12
  1169. +#define N_HDLC 13
  1170. +#define N_SYNC_PPP 14
  1171. +#define N_HCI 15
  1172. +
  1173. +#define FIOGETOWN _IOR('f', 123, int)
  1174. +#define FIOSETOWN _IOW('f', 124, int)
  1175. +
  1176. +#define SIOCATMARK _IOR('s', 7, int)
  1177. +#define SIOCSPGRP _IOW('s', 8, int)
  1178. +#define SIOCGPGRP _IOW('s', 9, int)
  1179. +#define SIOCGSTAMP _IOR('s', 100, char[8])
  1180. +
  1181. +#define SIOCADDRT 0x890B
  1182. +#define SIOCDELRT 0x890C
  1183. +#define SIOCRTMSG 0x890D
  1184. +
  1185. +#define SIOCGIFNAME 0x8910
  1186. +#define SIOCSIFLINK 0x8911
  1187. +#define SIOCGIFCONF 0x8912
  1188. +#define SIOCGIFFLAGS 0x8913
  1189. +#define SIOCSIFFLAGS 0x8914
  1190. +#define SIOCGIFADDR 0x8915
  1191. +#define SIOCSIFADDR 0x8916
  1192. +#define SIOCGIFDSTADDR 0x8917
  1193. +#define SIOCSIFDSTADDR 0x8918
  1194. +#define SIOCGIFBRDADDR 0x8919
  1195. +#define SIOCSIFBRDADDR 0x891a
  1196. +#define SIOCGIFNETMASK 0x891b
  1197. +#define SIOCSIFNETMASK 0x891c
  1198. +#define SIOCGIFMETRIC 0x891d
  1199. +#define SIOCSIFMETRIC 0x891e
  1200. +#define SIOCGIFMEM 0x891f
  1201. +#define SIOCSIFMEM 0x8920
  1202. +#define SIOCGIFMTU 0x8921
  1203. +#define SIOCSIFMTU 0x8922
  1204. +#define SIOCSIFHWADDR 0x8924
  1205. +#define SIOCGIFENCAP 0x8925
  1206. +#define SIOCSIFENCAP 0x8926
  1207. +#define SIOCGIFHWADDR 0x8927
  1208. +#define SIOCGIFSLAVE 0x8929
  1209. +#define SIOCSIFSLAVE 0x8930
  1210. +#define SIOCADDMULTI 0x8931
  1211. +#define SIOCDELMULTI 0x8932
  1212. +#define SIOCGIFINDEX 0x8933
  1213. +#define SIOGIFINDEX SIOCGIFINDEX
  1214. +#define SIOCSIFPFLAGS 0x8934
  1215. +#define SIOCGIFPFLAGS 0x8935
  1216. +#define SIOCDIFADDR 0x8936
  1217. +#define SIOCSIFHWBROADCAST 0x8937
  1218. +#define SIOCGIFCOUNT 0x8938
  1219. +
  1220. +#define SIOCGIFBR 0x8940
  1221. +#define SIOCSIFBR 0x8941
  1222. +
  1223. +#define SIOCGIFTXQLEN 0x8942
  1224. +#define SIOCSIFTXQLEN 0x8943
  1225. +
  1226. +#define SIOCDARP 0x8953
  1227. +#define SIOCGARP 0x8954
  1228. +#define SIOCSARP 0x8955
  1229. +
  1230. +#define SIOCDRARP 0x8960
  1231. +#define SIOCGRARP 0x8961
  1232. +#define SIOCSRARP 0x8962
  1233. +
  1234. +#define SIOCGIFMAP 0x8970
  1235. +#define SIOCSIFMAP 0x8971
  1236. +
  1237. +#define SIOCADDDLCI 0x8980
  1238. +#define SIOCDELDLCI 0x8981
  1239. +
  1240. +#define SIOCDEVPRIVATE 0x89F0
  1241. +#define SIOCPROTOPRIVATE 0x89E0
  1242. diff -Nur musl-0.9.15/arch/sh/bits/ipc.h musl-git/arch/sh/bits/ipc.h
  1243. --- musl-0.9.15/arch/sh/bits/ipc.h 1970-01-01 01:00:00.000000000 +0100
  1244. +++ musl-git/arch/sh/bits/ipc.h 2014-03-19 07:42:48.000000000 +0100
  1245. @@ -0,0 +1,14 @@
  1246. +struct ipc_perm
  1247. +{
  1248. + key_t __ipc_perm_key;
  1249. + uid_t uid;
  1250. + gid_t gid;
  1251. + uid_t cuid;
  1252. + gid_t cgid;
  1253. + mode_t mode;
  1254. + int __ipc_perm_seq;
  1255. + long __pad1;
  1256. + long __pad2;
  1257. +};
  1258. +
  1259. +#define IPC_64 0x100
  1260. diff -Nur musl-0.9.15/arch/sh/bits/limits.h musl-git/arch/sh/bits/limits.h
  1261. --- musl-0.9.15/arch/sh/bits/limits.h 1970-01-01 01:00:00.000000000 +0100
  1262. +++ musl-git/arch/sh/bits/limits.h 2014-03-19 07:42:48.000000000 +0100
  1263. @@ -0,0 +1,8 @@
  1264. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  1265. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1266. +#define PAGE_SIZE 4096
  1267. +#define LONG_BIT 32
  1268. +#endif
  1269. +
  1270. +#define LONG_MAX 0x7fffffffL
  1271. +#define LLONG_MAX 0x7fffffffffffffffLL
  1272. diff -Nur musl-0.9.15/arch/sh/bits/mman.h musl-git/arch/sh/bits/mman.h
  1273. --- musl-0.9.15/arch/sh/bits/mman.h 1970-01-01 01:00:00.000000000 +0100
  1274. +++ musl-git/arch/sh/bits/mman.h 2014-03-19 07:42:48.000000000 +0100
  1275. @@ -0,0 +1,62 @@
  1276. +#define MAP_FAILED ((void *) -1)
  1277. +
  1278. +#define PROT_NONE 0
  1279. +#define PROT_READ 1
  1280. +#define PROT_WRITE 2
  1281. +#define PROT_EXEC 4
  1282. +#define PROT_GROWSDOWN 0x01000000
  1283. +#define PROT_GROWSUP 0x02000000
  1284. +
  1285. +#define MAP_SHARED 0x01
  1286. +#define MAP_PRIVATE 0x02
  1287. +#define MAP_FIXED 0x10
  1288. +
  1289. +#define MAP_TYPE 0x0f
  1290. +#define MAP_FILE 0x00
  1291. +#define MAP_ANON 0x20
  1292. +#define MAP_ANONYMOUS MAP_ANON
  1293. +#define MAP_32BIT 0x40
  1294. +#define MAP_NORESERVE 0x4000
  1295. +#define MAP_GROWSDOWN 0x0100
  1296. +#define MAP_DENYWRITE 0x0800
  1297. +#define MAP_EXECUTABLE 0x1000
  1298. +#define MAP_LOCKED 0x2000
  1299. +#define MAP_POPULATE 0x8000
  1300. +#define MAP_NONBLOCK 0x10000
  1301. +#define MAP_STACK 0x20000
  1302. +#define MAP_HUGETLB 0x40000
  1303. +
  1304. +#define POSIX_MADV_NORMAL 0
  1305. +#define POSIX_MADV_RANDOM 1
  1306. +#define POSIX_MADV_SEQUENTIAL 2
  1307. +#define POSIX_MADV_WILLNEED 3
  1308. +#define POSIX_MADV_DONTNEED 4
  1309. +
  1310. +#define MS_ASYNC 1
  1311. +#define MS_INVALIDATE 2
  1312. +#define MS_SYNC 4
  1313. +
  1314. +#define MCL_CURRENT 1
  1315. +#define MCL_FUTURE 2
  1316. +
  1317. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1318. +#define MADV_NORMAL 0
  1319. +#define MADV_RANDOM 1
  1320. +#define MADV_SEQUENTIAL 2
  1321. +#define MADV_WILLNEED 3
  1322. +#define MADV_DONTNEED 4
  1323. +#define MADV_REMOVE 9
  1324. +#define MADV_DONTFORK 10
  1325. +#define MADV_DOFORK 11
  1326. +#define MADV_MERGEABLE 12
  1327. +#define MADV_UNMERGEABLE 13
  1328. +#define MADV_HUGEPAGE 14
  1329. +#define MADV_NOHUGEPAGE 15
  1330. +#define MADV_DONTDUMP 16
  1331. +#define MADV_DODUMP 17
  1332. +#define MADV_HWPOISON 100
  1333. +#define MADV_SOFT_OFFLINE 101
  1334. +
  1335. +#define MREMAP_MAYMOVE 1
  1336. +#define MREMAP_FIXED 2
  1337. +#endif
  1338. diff -Nur musl-0.9.15/arch/sh/bits/msg.h musl-git/arch/sh/bits/msg.h
  1339. --- musl-0.9.15/arch/sh/bits/msg.h 1970-01-01 01:00:00.000000000 +0100
  1340. +++ musl-git/arch/sh/bits/msg.h 2014-03-19 07:42:48.000000000 +0100
  1341. @@ -0,0 +1,16 @@
  1342. +struct msqid_ds
  1343. +{
  1344. + struct ipc_perm msg_perm;
  1345. + time_t msg_stime;
  1346. + int __unused1;
  1347. + time_t msg_rtime;
  1348. + int __unused2;
  1349. + time_t msg_ctime;
  1350. + int __unused3;
  1351. + unsigned long msg_cbytes;
  1352. + msgqnum_t msg_qnum;
  1353. + msglen_t msg_qbytes;
  1354. + pid_t msg_lspid;
  1355. + pid_t msg_lrpid;
  1356. + unsigned long __unused[2];
  1357. +};
  1358. diff -Nur musl-0.9.15/arch/sh/bits/posix.h musl-git/arch/sh/bits/posix.h
  1359. --- musl-0.9.15/arch/sh/bits/posix.h 1970-01-01 01:00:00.000000000 +0100
  1360. +++ musl-git/arch/sh/bits/posix.h 2014-03-19 07:42:48.000000000 +0100
  1361. @@ -0,0 +1,2 @@
  1362. +#define _POSIX_V6_ILP32_OFFBIG 1
  1363. +#define _POSIX_V7_ILP32_OFFBIG 1
  1364. diff -Nur musl-0.9.15/arch/sh/bits/sem.h musl-git/arch/sh/bits/sem.h
  1365. --- musl-0.9.15/arch/sh/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  1366. +++ musl-git/arch/sh/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  1367. @@ -0,0 +1,16 @@
  1368. +struct semid_ds {
  1369. + struct ipc_perm sem_perm;
  1370. + time_t sem_otime;
  1371. + time_t __unused1;
  1372. + time_t sem_ctime;
  1373. + time_t __unused2;
  1374. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  1375. + unsigned short sem_nsems;
  1376. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  1377. +#else
  1378. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  1379. + unsigned short sem_nsems;
  1380. +#endif
  1381. + time_t __unused3;
  1382. + time_t __unused4;
  1383. +};
  1384. diff -Nur musl-0.9.15/arch/sh/bits/setjmp.h musl-git/arch/sh/bits/setjmp.h
  1385. --- musl-0.9.15/arch/sh/bits/setjmp.h 1970-01-01 01:00:00.000000000 +0100
  1386. +++ musl-git/arch/sh/bits/setjmp.h 2014-03-19 07:42:48.000000000 +0100
  1387. @@ -0,0 +1 @@
  1388. +typedef unsigned long __jmp_buf[13];
  1389. diff -Nur musl-0.9.15/arch/sh/bits/shm.h musl-git/arch/sh/bits/shm.h
  1390. --- musl-0.9.15/arch/sh/bits/shm.h 1970-01-01 01:00:00.000000000 +0100
  1391. +++ musl-git/arch/sh/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  1392. @@ -0,0 +1,28 @@
  1393. +#define SHMLBA 16384
  1394. +
  1395. +struct shmid_ds
  1396. +{
  1397. + struct ipc_perm shm_perm;
  1398. + size_t shm_segsz;
  1399. + time_t shm_atime;
  1400. + int __unused1;
  1401. + time_t shm_dtime;
  1402. + int __unused2;
  1403. + time_t shm_ctime;
  1404. + int __unused3;
  1405. + pid_t shm_cpid;
  1406. + pid_t shm_lpid;
  1407. + unsigned long shm_nattch;
  1408. + unsigned long __pad1;
  1409. + unsigned long __pad2;
  1410. +};
  1411. +
  1412. +struct shminfo {
  1413. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  1414. +};
  1415. +
  1416. +struct shm_info {
  1417. + int __used_ids;
  1418. + unsigned long shm_tot, shm_rss, shm_swp;
  1419. + unsigned long __swap_attempts, __swap_successes;
  1420. +};
  1421. diff -Nur musl-0.9.15/arch/sh/bits/signal.h musl-git/arch/sh/bits/signal.h
  1422. --- musl-0.9.15/arch/sh/bits/signal.h 1970-01-01 01:00:00.000000000 +0100
  1423. +++ musl-git/arch/sh/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  1424. @@ -0,0 +1,82 @@
  1425. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  1426. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1427. +
  1428. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1429. +typedef int greg_t, gregset_t[16];
  1430. +typedef int freg_t, fpregset_t[16];
  1431. +typedef struct sigcontext {
  1432. + unsigned long oldmask;
  1433. + unsigned long sc_regs[16];
  1434. + unsigned long sc_pc, sc_pr, sc_sr;
  1435. + unsigned long sc_gbr, sc_mach, sc_macl;
  1436. + unsigned long sc_fpregs[16];
  1437. + unsigned long sc_xfpregs[16];
  1438. + unsigned int sc_fpscr, sc_fpul, sc_ownedfp;
  1439. +} mcontext_t;
  1440. +#else
  1441. +typedef struct {
  1442. + unsigned long __regs[58];
  1443. +} mcontext_t;
  1444. +#endif
  1445. +
  1446. +struct sigaltstack {
  1447. + void *ss_sp;
  1448. + int ss_flags;
  1449. + size_t ss_size;
  1450. +};
  1451. +
  1452. +typedef struct __ucontext {
  1453. + unsigned long uc_flags;
  1454. + struct __ucontext *uc_link;
  1455. + stack_t uc_stack;
  1456. + mcontext_t uc_mcontext;
  1457. + sigset_t uc_sigmask;
  1458. +} ucontext_t;
  1459. +
  1460. +#define SA_NOCLDSTOP 1
  1461. +#define SA_NOCLDWAIT 2
  1462. +#define SA_SIGINFO 4
  1463. +#define SA_ONSTACK 0x08000000
  1464. +#define SA_RESTART 0x10000000
  1465. +#define SA_NODEFER 0x40000000
  1466. +#define SA_RESETHAND 0x80000000
  1467. +#define SA_RESTORER 0x04000000
  1468. +
  1469. +#endif
  1470. +
  1471. +#define SIGHUP 1
  1472. +#define SIGINT 2
  1473. +#define SIGQUIT 3
  1474. +#define SIGILL 4
  1475. +#define SIGTRAP 5
  1476. +#define SIGABRT 6
  1477. +#define SIGIOT SIGABRT
  1478. +#define SIGBUS 7
  1479. +#define SIGFPE 8
  1480. +#define SIGKILL 9
  1481. +#define SIGUSR1 10
  1482. +#define SIGSEGV 11
  1483. +#define SIGUSR2 12
  1484. +#define SIGPIPE 13
  1485. +#define SIGALRM 14
  1486. +#define SIGTERM 15
  1487. +#define SIGSTKFLT 16
  1488. +#define SIGCHLD 17
  1489. +#define SIGCONT 18
  1490. +#define SIGSTOP 19
  1491. +#define SIGTSTP 20
  1492. +#define SIGTTIN 21
  1493. +#define SIGTTOU 22
  1494. +#define SIGURG 23
  1495. +#define SIGXCPU 24
  1496. +#define SIGXFSZ 25
  1497. +#define SIGVTALRM 26
  1498. +#define SIGPROF 27
  1499. +#define SIGWINCH 28
  1500. +#define SIGIO 29
  1501. +#define SIGPOLL 29
  1502. +#define SIGPWR 30
  1503. +#define SIGSYS 31
  1504. +#define SIGUNUSED SIGSYS
  1505. +
  1506. +#define _NSIG 65
  1507. diff -Nur musl-0.9.15/arch/sh/bits/socket.h musl-git/arch/sh/bits/socket.h
  1508. --- musl-0.9.15/arch/sh/bits/socket.h 1970-01-01 01:00:00.000000000 +0100
  1509. +++ musl-git/arch/sh/bits/socket.h 2014-03-19 07:42:48.000000000 +0100
  1510. @@ -0,0 +1,17 @@
  1511. +struct msghdr
  1512. +{
  1513. + void *msg_name;
  1514. + socklen_t msg_namelen;
  1515. + struct iovec *msg_iov;
  1516. + int msg_iovlen;
  1517. + void *msg_control;
  1518. + socklen_t msg_controllen;
  1519. + int msg_flags;
  1520. +};
  1521. +
  1522. +struct cmsghdr
  1523. +{
  1524. + socklen_t cmsg_len;
  1525. + int cmsg_level;
  1526. + int cmsg_type;
  1527. +};
  1528. diff -Nur musl-0.9.15/arch/sh/bits/statfs.h musl-git/arch/sh/bits/statfs.h
  1529. --- musl-0.9.15/arch/sh/bits/statfs.h 1970-01-01 01:00:00.000000000 +0100
  1530. +++ musl-git/arch/sh/bits/statfs.h 2014-03-19 07:42:48.000000000 +0100
  1531. @@ -0,0 +1,7 @@
  1532. +struct statfs {
  1533. + unsigned long f_type, f_bsize;
  1534. + fsblkcnt_t f_blocks, f_bfree, f_bavail;
  1535. + fsfilcnt_t f_files, f_ffree;
  1536. + fsid_t f_fsid;
  1537. + unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
  1538. +};
  1539. diff -Nur musl-0.9.15/arch/sh/bits/stat.h musl-git/arch/sh/bits/stat.h
  1540. --- musl-0.9.15/arch/sh/bits/stat.h 1970-01-01 01:00:00.000000000 +0100
  1541. +++ musl-git/arch/sh/bits/stat.h 2014-03-19 07:42:48.000000000 +0100
  1542. @@ -0,0 +1,22 @@
  1543. +/* copied from kernel definition, but with padding replaced
  1544. + * by the corresponding correctly-sized userspace types. */
  1545. +
  1546. +struct stat
  1547. +{
  1548. + dev_t st_dev;
  1549. + int __st_dev_padding;
  1550. + long __st_ino_truncated;
  1551. + mode_t st_mode;
  1552. + nlink_t st_nlink;
  1553. + uid_t st_uid;
  1554. + gid_t st_gid;
  1555. + dev_t st_rdev;
  1556. + int __st_rdev_padding;
  1557. + off_t st_size;
  1558. + blksize_t st_blksize;
  1559. + blkcnt_t st_blocks;
  1560. + struct timespec st_atim;
  1561. + struct timespec st_mtim;
  1562. + struct timespec st_ctim;
  1563. + ino_t st_ino;
  1564. +};
  1565. diff -Nur musl-0.9.15/arch/sh/bits/stdarg.h musl-git/arch/sh/bits/stdarg.h
  1566. --- musl-0.9.15/arch/sh/bits/stdarg.h 1970-01-01 01:00:00.000000000 +0100
  1567. +++ musl-git/arch/sh/bits/stdarg.h 2014-03-19 07:42:48.000000000 +0100
  1568. @@ -0,0 +1,4 @@
  1569. +#define va_start(v,l) __builtin_va_start(v,l)
  1570. +#define va_end(v) __builtin_va_end(v)
  1571. +#define va_arg(v,l) __builtin_va_arg(v,l)
  1572. +#define va_copy(d,s) __builtin_va_copy(d,s)
  1573. diff -Nur musl-0.9.15/arch/sh/bits/stdint.h musl-git/arch/sh/bits/stdint.h
  1574. --- musl-0.9.15/arch/sh/bits/stdint.h 1970-01-01 01:00:00.000000000 +0100
  1575. +++ musl-git/arch/sh/bits/stdint.h 2014-03-19 07:42:48.000000000 +0100
  1576. @@ -0,0 +1,20 @@
  1577. +typedef int32_t int_fast16_t;
  1578. +typedef int32_t int_fast32_t;
  1579. +typedef uint32_t uint_fast16_t;
  1580. +typedef uint32_t uint_fast32_t;
  1581. +
  1582. +#define INT_FAST16_MIN INT32_MIN
  1583. +#define INT_FAST32_MIN INT32_MIN
  1584. +
  1585. +#define INT_FAST16_MAX INT32_MAX
  1586. +#define INT_FAST32_MAX INT32_MAX
  1587. +
  1588. +#define UINT_FAST16_MAX UINT32_MAX
  1589. +#define UINT_FAST32_MAX UINT32_MAX
  1590. +
  1591. +#define INTPTR_MIN INT32_MIN
  1592. +#define INTPTR_MAX INT32_MAX
  1593. +#define UINTPTR_MAX UINT32_MAX
  1594. +#define PTRDIFF_MIN INT32_MIN
  1595. +#define PTRDIFF_MAX INT32_MAX
  1596. +#define SIZE_MAX UINT32_MAX
  1597. diff -Nur musl-0.9.15/arch/sh/bits/syscall.h musl-git/arch/sh/bits/syscall.h
  1598. --- musl-0.9.15/arch/sh/bits/syscall.h 1970-01-01 01:00:00.000000000 +0100
  1599. +++ musl-git/arch/sh/bits/syscall.h 2014-03-19 07:42:48.000000000 +0100
  1600. @@ -0,0 +1,684 @@
  1601. +#define __NR_restart_syscall 0
  1602. +#define __NR_exit 1
  1603. +#define __NR_fork 2
  1604. +#define __NR_read 3
  1605. +#define __NR_write 4
  1606. +#define __NR_open 5
  1607. +#define __NR_close 6
  1608. +#define __NR_waitpid 7
  1609. +#define __NR_creat 8
  1610. +#define __NR_link 9
  1611. +#define __NR_unlink 10
  1612. +#define __NR_execve 11
  1613. +#define __NR_chdir 12
  1614. +#define __NR_time 13
  1615. +#define __NR_mknod 14
  1616. +#define __NR_chmod 15
  1617. +#define __NR_lchown 16
  1618. +#define __NR_oldstat 18
  1619. +#define __NR_lseek 19
  1620. +#define __NR_getpid 20
  1621. +#define __NR_mount 21
  1622. +#define __NR_umount 22
  1623. +#define __NR_setuid 23
  1624. +#define __NR_getuid 24
  1625. +#define __NR_stime 25
  1626. +#define __NR_ptrace 26
  1627. +#define __NR_alarm 27
  1628. +#define __NR_oldfstat 28
  1629. +#define __NR_pause 29
  1630. +#define __NR_utime 30
  1631. +#define __NR_access 33
  1632. +#define __NR_nice 34
  1633. +#define __NR_sync 36
  1634. +#define __NR_kill 37
  1635. +#define __NR_rename 38
  1636. +#define __NR_mkdir 39
  1637. +#define __NR_rmdir 40
  1638. +#define __NR_dup 41
  1639. +#define __NR_pipe 42
  1640. +#define __NR_times 43
  1641. +#define __NR_brk 45
  1642. +#define __NR_setgid 46
  1643. +#define __NR_getgid 47
  1644. +#define __NR_signal 48
  1645. +#define __NR_geteuid 49
  1646. +#define __NR_getegid 50
  1647. +#define __NR_acct 51
  1648. +#define __NR_umount2 52
  1649. +#define __NR_ioctl 54
  1650. +#define __NR_fcntl 55
  1651. +#define __NR_setpgid 57
  1652. +#define __NR_umask 60
  1653. +#define __NR_chroot 61
  1654. +#define __NR_ustat 62
  1655. +#define __NR_dup2 63
  1656. +#define __NR_getppid 64
  1657. +#define __NR_getpgrp 65
  1658. +#define __NR_setsid 66
  1659. +#define __NR_sigaction 67
  1660. +#define __NR_sgetmask 68
  1661. +#define __NR_ssetmask 69
  1662. +#define __NR_setreuid 70
  1663. +#define __NR_setregid 71
  1664. +#define __NR_sigsuspend 72
  1665. +#define __NR_sigpending 73
  1666. +#define __NR_sethostname 74
  1667. +#define __NR_setrlimit 75
  1668. +#define __NR_getrlimit 76
  1669. +#define __NR_getrusage 77
  1670. +#define __NR_gettimeofday 78
  1671. +#define __NR_settimeofday 79
  1672. +#define __NR_getgroups 80
  1673. +#define __NR_setgroups 81
  1674. +#define __NR_symlink 83
  1675. +#define __NR_oldlstat 84
  1676. +#define __NR_readlink 85
  1677. +#define __NR_uselib 86
  1678. +#define __NR_swapon 87
  1679. +#define __NR_reboot 88
  1680. +#define __NR_readdir 89
  1681. +#define __NR_mmap 90
  1682. +#define __NR_munmap 91
  1683. +#define __NR_truncate 92
  1684. +#define __NR_ftruncate 93
  1685. +#define __NR_fchmod 94
  1686. +#define __NR_fchown 95
  1687. +#define __NR_getpriority 96
  1688. +#define __NR_setpriority 97
  1689. +#define __NR_statfs 99
  1690. +#define __NR_fstatfs 100
  1691. +#define __NR_socketcall 102
  1692. +#define __NR_syslog 103
  1693. +#define __NR_setitimer 104
  1694. +#define __NR_getitimer 105
  1695. +#define __NR_stat 106
  1696. +#define __NR_lstat 107
  1697. +#define __NR_fstat 108
  1698. +#define __NR_olduname 109
  1699. +#define __NR_vhangup 111
  1700. +#define __NR_wait4 114
  1701. +#define __NR_swapoff 115
  1702. +#define __NR_sysinfo 116
  1703. +#define __NR_ipc 117
  1704. +#define __NR_fsync 118
  1705. +#define __NR_sigreturn 119
  1706. +#define __NR_clone 120
  1707. +#define __NR_setdomainname 121
  1708. +#define __NR_uname 122
  1709. +#define __NR_cacheflush 123
  1710. +#define __NR_adjtimex 124
  1711. +#define __NR_mprotect 125
  1712. +#define __NR_sigprocmask 126
  1713. +#define __NR_init_module 128
  1714. +#define __NR_delete_module 129
  1715. +#define __NR_quotactl 131
  1716. +#define __NR_getpgid 132
  1717. +#define __NR_fchdir 133
  1718. +#define __NR_bdflush 134
  1719. +#define __NR_sysfs 135
  1720. +#define __NR_personality 136
  1721. +#define __NR_setfsuid 138
  1722. +#define __NR_setfsgid 139
  1723. +#define __NR__llseek 140
  1724. +#define __NR_getdents 141
  1725. +#define __NR__newselect 142
  1726. +#define __NR_flock 143
  1727. +#define __NR_msync 144
  1728. +#define __NR_readv 145
  1729. +#define __NR_writev 146
  1730. +#define __NR_getsid 147
  1731. +#define __NR_fdatasync 148
  1732. +#define __NR__sysctl 149
  1733. +#define __NR_mlock 150
  1734. +#define __NR_munlock 151
  1735. +#define __NR_mlockall 152
  1736. +#define __NR_munlockall 153
  1737. +#define __NR_sched_setparam 154
  1738. +#define __NR_sched_getparam 155
  1739. +#define __NR_sched_setscheduler 156
  1740. +#define __NR_sched_getscheduler 157
  1741. +#define __NR_sched_yield 158
  1742. +#define __NR_sched_get_priority_max 159
  1743. +#define __NR_sched_get_priority_min 160
  1744. +#define __NR_sched_rr_get_interval 161
  1745. +#define __NR_nanosleep 162
  1746. +#define __NR_mremap 163
  1747. +#define __NR_setresuid 164
  1748. +#define __NR_getresuid 165
  1749. +#define __NR_poll 168
  1750. +#define __NR_nfsservctl 169
  1751. +#define __NR_setresgid 170
  1752. +#define __NR_getresgid 171
  1753. +#define __NR_prctl 172
  1754. +#define __NR_rt_sigreturn 173
  1755. +#define __NR_rt_sigaction 174
  1756. +#define __NR_rt_sigprocmask 175
  1757. +#define __NR_rt_sigpending 176
  1758. +#define __NR_rt_sigtimedwait 177
  1759. +#define __NR_rt_sigqueueinfo 178
  1760. +#define __NR_rt_sigsuspend 179
  1761. +#define __NR_pread64 180
  1762. +#define __NR_pwrite64 181
  1763. +#define __NR_chown 182
  1764. +#define __NR_getcwd 183
  1765. +#define __NR_capget 184
  1766. +#define __NR_capset 185
  1767. +#define __NR_sigaltstack 186
  1768. +#define __NR_sendfile 187
  1769. +#define __NR_vfork 190
  1770. +#define __NR_ugetrlimit 191
  1771. +#define __NR_mmap2 192
  1772. +#define __NR_truncate64 193
  1773. +#define __NR_ftruncate64 194
  1774. +#define __NR_stat64 195
  1775. +#define __NR_lstat64 196
  1776. +#define __NR_fstat64 197
  1777. +#define __NR_lchown32 198
  1778. +#define __NR_getuid32 199
  1779. +#define __NR_getgid32 200
  1780. +#define __NR_geteuid32 201
  1781. +#define __NR_getegid32 202
  1782. +#define __NR_setreuid32 203
  1783. +#define __NR_setregid32 204
  1784. +#define __NR_getgroups32 205
  1785. +#define __NR_setgroups32 206
  1786. +#define __NR_fchown32 207
  1787. +#define __NR_setresuid32 208
  1788. +#define __NR_getresuid32 209
  1789. +#define __NR_setresgid32 210
  1790. +#define __NR_getresgid32 211
  1791. +#define __NR_chown32 212
  1792. +#define __NR_setuid32 213
  1793. +#define __NR_setgid32 214
  1794. +#define __NR_setfsuid32 215
  1795. +#define __NR_setfsgid32 216
  1796. +#define __NR_pivot_root 217
  1797. +#define __NR_mincore 218
  1798. +#define __NR_madvise 219
  1799. +#define __NR_getdents64 220
  1800. +#define __NR_fcntl64 221
  1801. +#define __NR_gettid 224
  1802. +#define __NR_readahead 225
  1803. +#define __NR_setxattr 226
  1804. +#define __NR_lsetxattr 227
  1805. +#define __NR_fsetxattr 228
  1806. +#define __NR_getxattr 229
  1807. +#define __NR_lgetxattr 230
  1808. +#define __NR_fgetxattr 231
  1809. +#define __NR_listxattr 232
  1810. +#define __NR_llistxattr 233
  1811. +#define __NR_flistxattr 234
  1812. +#define __NR_removexattr 235
  1813. +#define __NR_lremovexattr 236
  1814. +#define __NR_fremovexattr 237
  1815. +#define __NR_tkill 238
  1816. +#define __NR_sendfile64 239
  1817. +#define __NR_futex 240
  1818. +#define __NR_sched_setaffinity 241
  1819. +#define __NR_sched_getaffinity 242
  1820. +#define __NR_io_setup 245
  1821. +#define __NR_io_destroy 246
  1822. +#define __NR_io_getevents 247
  1823. +#define __NR_io_submit 248
  1824. +#define __NR_io_cancel 249
  1825. +#define __NR_fadvise64 250
  1826. +#define __NR_exit_group 252
  1827. +#define __NR_lookup_dcookie 253
  1828. +#define __NR_epoll_create 254
  1829. +#define __NR_epoll_ctl 255
  1830. +#define __NR_epoll_wait 256
  1831. +#define __NR_remap_file_pages 257
  1832. +#define __NR_set_tid_address 258
  1833. +#define __NR_timer_create 259
  1834. +#define __NR_timer_settime 260
  1835. +#define __NR_timer_gettime 261
  1836. +#define __NR_timer_getoverrun 262
  1837. +#define __NR_timer_delete 263
  1838. +#define __NR_clock_settime 264
  1839. +#define __NR_clock_gettime 265
  1840. +#define __NR_clock_getres 266
  1841. +#define __NR_clock_nanosleep 267
  1842. +#define __NR_statfs64 268
  1843. +#define __NR_fstatfs64 269
  1844. +#define __NR_tgkill 270
  1845. +#define __NR_utimes 271
  1846. +#define __NR_fadvise64_64 272
  1847. +#define __NR_mbind 274
  1848. +#define __NR_get_mempolicy 275
  1849. +#define __NR_set_mempolicy 276
  1850. +#define __NR_mq_open 277
  1851. +#define __NR_mq_unlink 278
  1852. +#define __NR_mq_timedsend 279
  1853. +#define __NR_mq_timedreceive 280
  1854. +#define __NR_mq_notify 281
  1855. +#define __NR_mq_getsetattr 282
  1856. +#define __NR_kexec_load 283
  1857. +#define __NR_waitid 284
  1858. +#define __NR_add_key 285
  1859. +#define __NR_request_key 286
  1860. +#define __NR_keyctl 287
  1861. +#define __NR_ioprio_set 288
  1862. +#define __NR_ioprio_get 289
  1863. +#define __NR_inotify_init 290
  1864. +#define __NR_inotify_add_watch 291
  1865. +#define __NR_inotify_rm_watch 292
  1866. +#define __NR_migrate_pages 294
  1867. +#define __NR_openat 295
  1868. +#define __NR_mkdirat 296
  1869. +#define __NR_mknodat 297
  1870. +#define __NR_fchownat 298
  1871. +#define __NR_futimesat 299
  1872. +#define __NR_fstatat64 300
  1873. +#define __NR_unlinkat 301
  1874. +#define __NR_renameat 302
  1875. +#define __NR_linkat 303
  1876. +#define __NR_symlinkat 304
  1877. +#define __NR_readlinkat 305
  1878. +#define __NR_fchmodat 306
  1879. +#define __NR_faccessat 307
  1880. +#define __NR_pselect6 308
  1881. +#define __NR_ppoll 309
  1882. +#define __NR_unshare 310
  1883. +#define __NR_set_robust_list 311
  1884. +#define __NR_get_robust_list 312
  1885. +#define __NR_splice 313
  1886. +#define __NR_sync_file_range 314
  1887. +#define __NR_tee 315
  1888. +#define __NR_vmsplice 316
  1889. +#define __NR_move_pages 317
  1890. +#define __NR_getcpu 318
  1891. +#define __NR_epoll_pwait 319
  1892. +#define __NR_utimensat 320
  1893. +#define __NR_signalfd 321
  1894. +#define __NR_timerfd_create 322
  1895. +#define __NR_eventfd 323
  1896. +#define __NR_fallocate 324
  1897. +#define __NR_timerfd_settime 325
  1898. +#define __NR_timerfd_gettime 326
  1899. +#define __NR_signalfd4 327
  1900. +#define __NR_eventfd2 328
  1901. +#define __NR_epoll_create1 329
  1902. +#define __NR_dup3 330
  1903. +#define __NR_pipe2 331
  1904. +#define __NR_inotify_init1 332
  1905. +#define __NR_preadv 333
  1906. +#define __NR_pwritev 334
  1907. +#define __NR_rt_tgsigqueueinfo 335
  1908. +#define __NR_perf_event_open 336
  1909. +#define __NR_fanotify_init 337
  1910. +#define __NR_fanotify_mark 338
  1911. +#define __NR_prlimit64 339
  1912. +#define __NR_socket 340
  1913. +#define __NR_bind 341
  1914. +#define __NR_connect 342
  1915. +#define __NR_listen 343
  1916. +#define __NR_accept 344
  1917. +#define __NR_getsockname 345
  1918. +#define __NR_getpeername 346
  1919. +#define __NR_socketpair 347
  1920. +#define __NR_send 348
  1921. +#define __NR_sendto 349
  1922. +#define __NR_recv 350
  1923. +#define __NR_recvfrom 351
  1924. +#define __NR_shutdown 352
  1925. +#define __NR_setsockopt 353
  1926. +#define __NR_getsockopt 354
  1927. +#define __NR_sendmsg 355
  1928. +#define __NR_recvmsg 356
  1929. +#define __NR_recvmmsg 357
  1930. +#define __NR_accept4 358
  1931. +#define __NR_name_to_handle_at 359
  1932. +#define __NR_open_by_handle_at 360
  1933. +#define __NR_clock_adjtime 361
  1934. +#define __NR_syncfs 362
  1935. +#define __NR_sendmmsg 363
  1936. +#define __NR_setns 364
  1937. +#define __NR_process_vm_readv 365
  1938. +#define __NR_process_vm_writev 366
  1939. +#define __NR_kcmp 367
  1940. +#define __NR_finit_module 368
  1941. +
  1942. +
  1943. +/* Repeated with SYS_ prefix */
  1944. +
  1945. +#define SYS_restart_syscall 0
  1946. +#define SYS_exit 1
  1947. +#define SYS_fork 2
  1948. +#define SYS_read 3
  1949. +#define SYS_write 4
  1950. +#define SYS_open 5
  1951. +#define SYS_close 6
  1952. +#define SYS_waitpid 7
  1953. +#define SYS_creat 8
  1954. +#define SYS_link 9
  1955. +#define SYS_unlink 10
  1956. +#define SYS_execve 11
  1957. +#define SYS_chdir 12
  1958. +#define SYS_time 13
  1959. +#define SYS_mknod 14
  1960. +#define SYS_chmod 15
  1961. +#define SYS_lchown 16
  1962. +#define SYS_oldstat 18
  1963. +#define SYS_lseek 19
  1964. +#define SYS_getpid 20
  1965. +#define SYS_mount 21
  1966. +#define SYS_umount 22
  1967. +#define SYS_setuid 23
  1968. +#define SYS_getuid 24
  1969. +#define SYS_stime 25
  1970. +#define SYS_ptrace 26
  1971. +#define SYS_alarm 27
  1972. +#define SYS_oldfstat 28
  1973. +#define SYS_pause 29
  1974. +#define SYS_utime 30
  1975. +#define SYS_access 33
  1976. +#define SYS_nice 34
  1977. +#define SYS_sync 36
  1978. +#define SYS_kill 37
  1979. +#define SYS_rename 38
  1980. +#define SYS_mkdir 39
  1981. +#define SYS_rmdir 40
  1982. +#define SYS_dup 41
  1983. +#define SYS_pipe 42
  1984. +#define SYS_times 43
  1985. +#define SYS_brk 45
  1986. +#define SYS_setgid 46
  1987. +#define SYS_getgid 47
  1988. +#define SYS_signal 48
  1989. +#define SYS_geteuid 49
  1990. +#define SYS_getegid 50
  1991. +#define SYS_acct 51
  1992. +#define SYS_umount2 52
  1993. +#define SYS_ioctl 54
  1994. +#define SYS_fcntl 55
  1995. +#define SYS_setpgid 57
  1996. +#define SYS_umask 60
  1997. +#define SYS_chroot 61
  1998. +#define SYS_ustat 62
  1999. +#define SYS_dup2 63
  2000. +#define SYS_getppid 64
  2001. +#define SYS_getpgrp 65
  2002. +#define SYS_setsid 66
  2003. +#define SYS_sigaction 67
  2004. +#define SYS_sgetmask 68
  2005. +#define SYS_ssetmask 69
  2006. +#define SYS_setreuid 70
  2007. +#define SYS_setregid 71
  2008. +#define SYS_sigsuspend 72
  2009. +#define SYS_sigpending 73
  2010. +#define SYS_sethostname 74
  2011. +#define SYS_setrlimit 75
  2012. +#define SYS_getrlimit 76
  2013. +#define SYS_getrusage 77
  2014. +#define SYS_gettimeofday 78
  2015. +#define SYS_settimeofday 79
  2016. +#define SYS_getgroups 80
  2017. +#define SYS_setgroups 81
  2018. +#define SYS_symlink 83
  2019. +#define SYS_oldlstat 84
  2020. +#define SYS_readlink 85
  2021. +#define SYS_uselib 86
  2022. +#define SYS_swapon 87
  2023. +#define SYS_reboot 88
  2024. +#define SYS_readdir 89
  2025. +#define SYS_mmap 90
  2026. +#define SYS_munmap 91
  2027. +#define SYS_truncate 92
  2028. +#define SYS_ftruncate 93
  2029. +#define SYS_fchmod 94
  2030. +#define SYS_fchown 95
  2031. +#define SYS_getpriority 96
  2032. +#define SYS_setpriority 97
  2033. +#define SYS_statfs 99
  2034. +#define SYS_fstatfs 100
  2035. +#define SYS_socketcall 102
  2036. +#define SYS_syslog 103
  2037. +#define SYS_setitimer 104
  2038. +#define SYS_getitimer 105
  2039. +#define SYS_stat 106
  2040. +#define SYS_lstat 107
  2041. +#define SYS_fstat 108
  2042. +#define SYS_olduname 109
  2043. +#define SYS_vhangup 111
  2044. +#define SYS_wait4 114
  2045. +#define SYS_swapoff 115
  2046. +#define SYS_sysinfo 116
  2047. +#define SYS_ipc 117
  2048. +#define SYS_fsync 118
  2049. +#define SYS_sigreturn 119
  2050. +#define SYS_clone 120
  2051. +#define SYS_setdomainname 121
  2052. +#define SYS_uname 122
  2053. +#define SYS_cacheflush 123
  2054. +#define SYS_adjtimex 124
  2055. +#define SYS_mprotect 125
  2056. +#define SYS_sigprocmask 126
  2057. +#define SYS_init_module 128
  2058. +#define SYS_delete_module 129
  2059. +#define SYS_quotactl 131
  2060. +#define SYS_getpgid 132
  2061. +#define SYS_fchdir 133
  2062. +#define SYS_bdflush 134
  2063. +#define SYS_sysfs 135
  2064. +#define SYS_personality 136
  2065. +#define SYS_setfsuid 138
  2066. +#define SYS_setfsgid 139
  2067. +#define SYS__llseek 140
  2068. +#define SYS_getdents 141
  2069. +#define SYS__newselect 142
  2070. +#define SYS_flock 143
  2071. +#define SYS_msync 144
  2072. +#define SYS_readv 145
  2073. +#define SYS_writev 146
  2074. +#define SYS_getsid 147
  2075. +#define SYS_fdatasync 148
  2076. +#define SYS__sysctl 149
  2077. +#define SYS_mlock 150
  2078. +#define SYS_munlock 151
  2079. +#define SYS_mlockall 152
  2080. +#define SYS_munlockall 153
  2081. +#define SYS_sched_setparam 154
  2082. +#define SYS_sched_getparam 155
  2083. +#define SYS_sched_setscheduler 156
  2084. +#define SYS_sched_getscheduler 157
  2085. +#define SYS_sched_yield 158
  2086. +#define SYS_sched_get_priority_max 159
  2087. +#define SYS_sched_get_priority_min 160
  2088. +#define SYS_sched_rr_get_interval 161
  2089. +#define SYS_nanosleep 162
  2090. +#define SYS_mremap 163
  2091. +#define SYS_setresuid 164
  2092. +#define SYS_getresuid 165
  2093. +#define SYS_poll 168
  2094. +#define SYS_nfsservctl 169
  2095. +#define SYS_setresgid 170
  2096. +#define SYS_getresgid 171
  2097. +#define SYS_prctl 172
  2098. +#define SYS_rt_sigreturn 173
  2099. +#define SYS_rt_sigaction 174
  2100. +#define SYS_rt_sigprocmask 175
  2101. +#define SYS_rt_sigpending 176
  2102. +#define SYS_rt_sigtimedwait 177
  2103. +#define SYS_rt_sigqueueinfo 178
  2104. +#define SYS_rt_sigsuspend 179
  2105. +#define SYS_pread64 180
  2106. +#define SYS_pwrite64 181
  2107. +#define SYS_chown 182
  2108. +#define SYS_getcwd 183
  2109. +#define SYS_capget 184
  2110. +#define SYS_capset 185
  2111. +#define SYS_sigaltstack 186
  2112. +#define SYS_sendfile 187
  2113. +#define SYS_vfork 190
  2114. +#define SYS_ugetrlimit 191
  2115. +#define SYS_mmap2 192
  2116. +#define SYS_truncate64 193
  2117. +#define SYS_ftruncate64 194
  2118. +#define SYS_stat64 195
  2119. +#define SYS_lstat64 196
  2120. +#define SYS_fstat64 197
  2121. +#define SYS_lchown32 198
  2122. +#define SYS_getuid32 199
  2123. +#define SYS_getgid32 200
  2124. +#define SYS_geteuid32 201
  2125. +#define SYS_getegid32 202
  2126. +#define SYS_setreuid32 203
  2127. +#define SYS_setregid32 204
  2128. +#define SYS_getgroups32 205
  2129. +#define SYS_setgroups32 206
  2130. +#define SYS_fchown32 207
  2131. +#define SYS_setresuid32 208
  2132. +#define SYS_getresuid32 209
  2133. +#define SYS_setresgid32 210
  2134. +#define SYS_getresgid32 211
  2135. +#define SYS_chown32 212
  2136. +#define SYS_setuid32 213
  2137. +#define SYS_setgid32 214
  2138. +#define SYS_setfsuid32 215
  2139. +#define SYS_setfsgid32 216
  2140. +#define SYS_pivot_root 217
  2141. +#define SYS_mincore 218
  2142. +#define SYS_madvise 219
  2143. +#define SYS_getdents64 220
  2144. +#define SYS_fcntl64 221
  2145. +#define SYS_gettid 224
  2146. +#define SYS_readahead 225
  2147. +#define SYS_setxattr 226
  2148. +#define SYS_lsetxattr 227
  2149. +#define SYS_fsetxattr 228
  2150. +#define SYS_getxattr 229
  2151. +#define SYS_lgetxattr 230
  2152. +#define SYS_fgetxattr 231
  2153. +#define SYS_listxattr 232
  2154. +#define SYS_llistxattr 233
  2155. +#define SYS_flistxattr 234
  2156. +#define SYS_removexattr 235
  2157. +#define SYS_lremovexattr 236
  2158. +#define SYS_fremovexattr 237
  2159. +#define SYS_tkill 238
  2160. +#define SYS_sendfile64 239
  2161. +#define SYS_futex 240
  2162. +#define SYS_sched_setaffinity 241
  2163. +#define SYS_sched_getaffinity 242
  2164. +#define SYS_io_setup 245
  2165. +#define SYS_io_destroy 246
  2166. +#define SYS_io_getevents 247
  2167. +#define SYS_io_submit 248
  2168. +#define SYS_io_cancel 249
  2169. +#define SYS_fadvise64 250
  2170. +#define SYS_exit_group 252
  2171. +#define SYS_lookup_dcookie 253
  2172. +#define SYS_epoll_create 254
  2173. +#define SYS_epoll_ctl 255
  2174. +#define SYS_epoll_wait 256
  2175. +#define SYS_remap_file_pages 257
  2176. +#define SYS_set_tid_address 258
  2177. +#define SYS_timer_create 259
  2178. +#define SYS_timer_settime 260
  2179. +#define SYS_timer_gettime 261
  2180. +#define SYS_timer_getoverrun 262
  2181. +#define SYS_timer_delete 263
  2182. +#define SYS_clock_settime 264
  2183. +#define SYS_clock_gettime 265
  2184. +#define SYS_clock_getres 266
  2185. +#define SYS_clock_nanosleep 267
  2186. +#define SYS_statfs64 268
  2187. +#define SYS_fstatfs64 269
  2188. +#define SYS_tgkill 270
  2189. +#define SYS_utimes 271
  2190. +#define SYS_fadvise64_64 272
  2191. +#define SYS_mbind 274
  2192. +#define SYS_get_mempolicy 275
  2193. +#define SYS_set_mempolicy 276
  2194. +#define SYS_mq_open 277
  2195. +#define SYS_mq_unlink 278
  2196. +#define SYS_mq_timedsend 279
  2197. +#define SYS_mq_timedreceive 280
  2198. +#define SYS_mq_notify 281
  2199. +#define SYS_mq_getsetattr 282
  2200. +#define SYS_kexec_load 283
  2201. +#define SYS_waitid 284
  2202. +#define SYS_add_key 285
  2203. +#define SYS_request_key 286
  2204. +#define SYS_keyctl 287
  2205. +#define SYS_ioprio_set 288
  2206. +#define SYS_ioprio_get 289
  2207. +#define SYS_inotify_init 290
  2208. +#define SYS_inotify_add_watch 291
  2209. +#define SYS_inotify_rm_watch 292
  2210. +#define SYS_migrate_pages 294
  2211. +#define SYS_openat 295
  2212. +#define SYS_mkdirat 296
  2213. +#define SYS_mknodat 297
  2214. +#define SYS_fchownat 298
  2215. +#define SYS_futimesat 299
  2216. +#define SYS_fstatat64 300
  2217. +#define SYS_unlinkat 301
  2218. +#define SYS_renameat 302
  2219. +#define SYS_linkat 303
  2220. +#define SYS_symlinkat 304
  2221. +#define SYS_readlinkat 305
  2222. +#define SYS_fchmodat 306
  2223. +#define SYS_faccessat 307
  2224. +#define SYS_pselect6 308
  2225. +#define SYS_ppoll 309
  2226. +#define SYS_unshare 310
  2227. +#define SYS_set_robust_list 311
  2228. +#define SYS_get_robust_list 312
  2229. +#define SYS_splice 313
  2230. +#define SYS_sync_file_range 314
  2231. +#define SYS_tee 315
  2232. +#define SYS_vmsplice 316
  2233. +#define SYS_move_pages 317
  2234. +#define SYS_getcpu 318
  2235. +#define SYS_epoll_pwait 319
  2236. +#define SYS_utimensat 320
  2237. +#define SYS_signalfd 321
  2238. +#define SYS_timerfd_create 322
  2239. +#define SYS_eventfd 323
  2240. +#define SYS_fallocate 324
  2241. +#define SYS_timerfd_settime 325
  2242. +#define SYS_timerfd_gettime 326
  2243. +#define SYS_signalfd4 327
  2244. +#define SYS_eventfd2 328
  2245. +#define SYS_epoll_create1 329
  2246. +#define SYS_dup3 330
  2247. +#define SYS_pipe2 331
  2248. +#define SYS_inotify_init1 332
  2249. +#define SYS_preadv 333
  2250. +#define SYS_pwritev 334
  2251. +#define SYS_rt_tgsigqueueinfo 335
  2252. +#define SYS_perf_event_open 336
  2253. +#define SYS_fanotify_init 337
  2254. +#define SYS_fanotify_mark 338
  2255. +#define SYS_prlimit64 339
  2256. +#define SYS_socket 340
  2257. +#define SYS_bind 341
  2258. +#define SYS_connect 342
  2259. +#define SYS_listen 343
  2260. +#define SYS_accept 344
  2261. +#define SYS_getsockname 345
  2262. +#define SYS_getpeername 346
  2263. +#define SYS_socketpair 347
  2264. +#define SYS_send 348
  2265. +#define SYS_sendto 349
  2266. +#define SYS_recv 350
  2267. +#define SYS_recvfrom 351
  2268. +#define SYS_shutdown 352
  2269. +#define SYS_setsockopt 353
  2270. +#define SYS_getsockopt 354
  2271. +#define SYS_sendmsg 355
  2272. +#define SYS_recvmsg 356
  2273. +#define SYS_recvmmsg 357
  2274. +#define SYS_accept4 358
  2275. +#define SYS_name_to_handle_at 359
  2276. +#define SYS_open_by_handle_at 360
  2277. +#define SYS_clock_adjtime 361
  2278. +#define SYS_syncfs 362
  2279. +#define SYS_sendmmsg 363
  2280. +#define SYS_setns 364
  2281. +#define SYS_process_vm_readv 365
  2282. +#define SYS_process_vm_writev 366
  2283. +#define SYS_kcmp 367
  2284. +#define SYS_finit_module 368
  2285. diff -Nur musl-0.9.15/arch/sh/bits/termios.h musl-git/arch/sh/bits/termios.h
  2286. --- musl-0.9.15/arch/sh/bits/termios.h 1970-01-01 01:00:00.000000000 +0100
  2287. +++ musl-git/arch/sh/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  2288. @@ -0,0 +1,160 @@
  2289. +struct termios
  2290. +{
  2291. + tcflag_t c_iflag;
  2292. + tcflag_t c_oflag;
  2293. + tcflag_t c_cflag;
  2294. + tcflag_t c_lflag;
  2295. + cc_t c_line;
  2296. + cc_t c_cc[NCCS];
  2297. + speed_t __c_ispeed;
  2298. + speed_t __c_ospeed;
  2299. +};
  2300. +
  2301. +#define VINTR 0
  2302. +#define VQUIT 1
  2303. +#define VERASE 2
  2304. +#define VKILL 3
  2305. +#define VEOF 4
  2306. +#define VTIME 5
  2307. +#define VMIN 6
  2308. +#define VSWTC 7
  2309. +#define VSTART 8
  2310. +#define VSTOP 9
  2311. +#define VSUSP 10
  2312. +#define VEOL 11
  2313. +#define VREPRINT 12
  2314. +#define VDISCARD 13
  2315. +#define VWERASE 14
  2316. +#define VLNEXT 15
  2317. +#define VEOL2 16
  2318. +
  2319. +#define IGNBRK 0000001
  2320. +#define BRKINT 0000002
  2321. +#define IGNPAR 0000004
  2322. +#define PARMRK 0000010
  2323. +#define INPCK 0000020
  2324. +#define ISTRIP 0000040
  2325. +#define INLCR 0000100
  2326. +#define IGNCR 0000200
  2327. +#define ICRNL 0000400
  2328. +#define IUCLC 0001000
  2329. +#define IXON 0002000
  2330. +#define IXANY 0004000
  2331. +#define IXOFF 0010000
  2332. +#define IMAXBEL 0020000
  2333. +#define IUTF8 0040000
  2334. +
  2335. +#define OPOST 0000001
  2336. +#define OLCUC 0000002
  2337. +#define ONLCR 0000004
  2338. +#define OCRNL 0000010
  2339. +#define ONOCR 0000020
  2340. +#define ONLRET 0000040
  2341. +#define OFILL 0000100
  2342. +#define OFDEL 0000200
  2343. +#define NLDLY 0000400
  2344. +#define NL0 0000000
  2345. +#define NL1 0000400
  2346. +#define CRDLY 0003000
  2347. +#define CR0 0000000
  2348. +#define CR1 0001000
  2349. +#define CR2 0002000
  2350. +#define CR3 0003000
  2351. +#define TABDLY 0014000
  2352. +#define TAB0 0000000
  2353. +#define TAB1 0004000
  2354. +#define TAB2 0010000
  2355. +#define TAB3 0014000
  2356. +#define BSDLY 0020000
  2357. +#define BS0 0000000
  2358. +#define BS1 0020000
  2359. +#define FFDLY 0100000
  2360. +#define FF0 0000000
  2361. +#define FF1 0100000
  2362. +
  2363. +#define VTDLY 0040000
  2364. +#define VT0 0000000
  2365. +#define VT1 0040000
  2366. +
  2367. +#define B0 0000000
  2368. +#define B50 0000001
  2369. +#define B75 0000002
  2370. +#define B110 0000003
  2371. +#define B134 0000004
  2372. +#define B150 0000005
  2373. +#define B200 0000006
  2374. +#define B300 0000007
  2375. +#define B600 0000010
  2376. +#define B1200 0000011
  2377. +#define B1800 0000012
  2378. +#define B2400 0000013
  2379. +#define B4800 0000014
  2380. +#define B9600 0000015
  2381. +#define B19200 0000016
  2382. +#define B38400 0000017
  2383. +
  2384. +#define B57600 0010001
  2385. +#define B115200 0010002
  2386. +#define B230400 0010003
  2387. +#define B460800 0010004
  2388. +#define B500000 0010005
  2389. +#define B576000 0010006
  2390. +#define B921600 0010007
  2391. +#define B1000000 0010010
  2392. +#define B1152000 0010011
  2393. +#define B1500000 0010012
  2394. +#define B2000000 0010013
  2395. +#define B2500000 0010014
  2396. +#define B3000000 0010015
  2397. +#define B3500000 0010016
  2398. +#define B4000000 0010017
  2399. +
  2400. +#define CBAUD 0010017
  2401. +
  2402. +#define CSIZE 0000060
  2403. +#define CS5 0000000
  2404. +#define CS6 0000020
  2405. +#define CS7 0000040
  2406. +#define CS8 0000060
  2407. +#define CSTOPB 0000100
  2408. +#define CREAD 0000200
  2409. +#define PARENB 0000400
  2410. +#define PARODD 0001000
  2411. +#define HUPCL 0002000
  2412. +#define CLOCAL 0004000
  2413. +
  2414. +#define ISIG 0000001
  2415. +#define ICANON 0000002
  2416. +#define ECHO 0000010
  2417. +#define ECHOE 0000020
  2418. +#define ECHOK 0000040
  2419. +#define ECHONL 0000100
  2420. +#define NOFLSH 0000200
  2421. +#define TOSTOP 0000400
  2422. +#define IEXTEN 0100000
  2423. +
  2424. +#define ECHOCTL 0001000
  2425. +#define ECHOPRT 0002000
  2426. +#define ECHOKE 0004000
  2427. +#define FLUSHO 0010000
  2428. +#define PENDIN 0040000
  2429. +
  2430. +#define TCOOFF 0
  2431. +#define TCOON 1
  2432. +#define TCIOFF 2
  2433. +#define TCION 3
  2434. +
  2435. +#define TCIFLUSH 0
  2436. +#define TCOFLUSH 1
  2437. +#define TCIOFLUSH 2
  2438. +
  2439. +#define TCSANOW 0
  2440. +#define TCSADRAIN 1
  2441. +#define TCSAFLUSH 2
  2442. +
  2443. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  2444. +#define CBAUDEX 0010000
  2445. +#define CRTSCTS 020000000000
  2446. +#define EXTPROC 0200000
  2447. +#define XTABS 0014000
  2448. +#endif
  2449. diff -Nur musl-0.9.15/arch/sh/bits/user.h musl-git/arch/sh/bits/user.h
  2450. --- musl-0.9.15/arch/sh/bits/user.h 1970-01-01 01:00:00.000000000 +0100
  2451. +++ musl-git/arch/sh/bits/user.h 2014-03-19 07:42:48.000000000 +0100
  2452. @@ -0,0 +1,75 @@
  2453. +#undef __WORDSIZE
  2454. +#define __WORDSIZE 32
  2455. +
  2456. +#define REG_REG0 0
  2457. +#define REG_REG15 15
  2458. +#define REG_PC 16
  2459. +#define REG_PR 17
  2460. +#define REG_SR 18
  2461. +#define REG_GBR 19
  2462. +#define REG_MACH 20
  2463. +#define REG_MACL 21
  2464. +#define REG_SYSCALL 22
  2465. +#define REG_FPREG0 23
  2466. +#define REG_FPREG15 38
  2467. +#define REG_XFREG0 39
  2468. +#define REG_XFREG15 54
  2469. +#define REG_FPSCR 55
  2470. +#define REG_FPUL 56
  2471. +
  2472. +struct pt_regs {
  2473. + unsigned long regs[16];
  2474. + unsigned long pc;
  2475. + unsigned long pr;
  2476. + unsigned long sr;
  2477. + unsigned long gbr;
  2478. + unsigned long mach;
  2479. + unsigned long macl;
  2480. + long tra;
  2481. +};
  2482. +
  2483. +struct pt_dspregs {
  2484. + unsigned long a1;
  2485. + unsigned long a0g;
  2486. + unsigned long a1g;
  2487. + unsigned long m0;
  2488. + unsigned long m1;
  2489. + unsigned long a0;
  2490. + unsigned long x0;
  2491. + unsigned long x1;
  2492. + unsigned long y0;
  2493. + unsigned long y1;
  2494. + unsigned long dsr;
  2495. + unsigned long rs;
  2496. + unsigned long re;
  2497. + unsigned long mod;
  2498. +};
  2499. +
  2500. +struct user_fpu_struct {
  2501. + unsigned long fp_regs[16];
  2502. + unsigned long xfp_regs[16];
  2503. + unsigned long fpscr;
  2504. + unsigned long fpul;
  2505. +};
  2506. +
  2507. +#define ELF_NGREG 23
  2508. +typedef unsigned long elf_greg_t;
  2509. +typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  2510. +typedef struct user_fpu_struct elf_fpregset_t;
  2511. +
  2512. +struct user {
  2513. + struct pt_regs regs;
  2514. + struct user_fpu_struct fpu;
  2515. + int u_fpvalid;
  2516. + unsigned long u_tsize;
  2517. + unsigned long u_dsize;
  2518. + unsigned long u_ssize;
  2519. + unsigned long start_code;
  2520. + unsigned long start_data;
  2521. + unsigned long start_stack;
  2522. + long int signal;
  2523. + unsigned long u_ar0;
  2524. + struct user_fpu_struct *u_fpstate;
  2525. + unsigned long magic;
  2526. + char u_comm[32];
  2527. +};
  2528. diff -Nur musl-0.9.15/arch/sh/crt_arch.h musl-git/arch/sh/crt_arch.h
  2529. --- musl-0.9.15/arch/sh/crt_arch.h 1970-01-01 01:00:00.000000000 +0100
  2530. +++ musl-git/arch/sh/crt_arch.h 2014-03-19 07:42:48.000000000 +0100
  2531. @@ -0,0 +1,12 @@
  2532. +__asm__("\
  2533. +.global _start \n\
  2534. +_start: \n\
  2535. + mov r15, r4 \n\
  2536. + mov #-16, r0 \n\
  2537. + and r0, r15 \n\
  2538. + bsr __cstart \n\
  2539. + nop \n\
  2540. +");
  2541. +
  2542. +/* used by gcc for switching the FPU between single and double precision */
  2543. +const unsigned long __fpscr_values[2] = { 0, 0x80000 };
  2544. diff -Nur musl-0.9.15/arch/sh/pthread_arch.h musl-git/arch/sh/pthread_arch.h
  2545. --- musl-0.9.15/arch/sh/pthread_arch.h 1970-01-01 01:00:00.000000000 +0100
  2546. +++ musl-git/arch/sh/pthread_arch.h 2014-03-19 07:42:48.000000000 +0100
  2547. @@ -0,0 +1,11 @@
  2548. +static inline struct pthread *__pthread_self()
  2549. +{
  2550. + char *self;
  2551. + __asm__ __volatile__ ("stc gbr,%0" : "=r" (self) );
  2552. + return (struct pthread *) (self + 8 - sizeof(struct pthread));
  2553. +}
  2554. +
  2555. +#define TLS_ABOVE_TP
  2556. +#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 8)
  2557. +
  2558. +#define CANCEL_REG_IP 17
  2559. diff -Nur musl-0.9.15/arch/sh/reloc.h musl-git/arch/sh/reloc.h
  2560. --- musl-0.9.15/arch/sh/reloc.h 1970-01-01 01:00:00.000000000 +0100
  2561. +++ musl-git/arch/sh/reloc.h 2014-03-19 07:42:48.000000000 +0100
  2562. @@ -0,0 +1,47 @@
  2563. +#if __BYTE_ORDER == __BIG_ENDIAN
  2564. +#define ENDIAN_SUFFIX "eb"
  2565. +#else
  2566. +#define ENDIAN_SUFFIX ""
  2567. +#endif
  2568. +
  2569. +#define LDSO_ARCH "sh" ENDIAN_SUFFIX
  2570. +
  2571. +#define IS_COPY(x) ((x) == R_SH_COPY)
  2572. +#define IS_PLT(x) ((x) == R_SH_JMP_SLOT)
  2573. +
  2574. +static inline void do_single_reloc(
  2575. + struct dso *self, unsigned char *base_addr,
  2576. + size_t *reloc_addr, int type, size_t addend,
  2577. + Sym *sym, size_t sym_size,
  2578. + struct symdef def, size_t sym_val)
  2579. +{
  2580. + switch(type) {
  2581. + case R_SH_GLOB_DAT:
  2582. + case R_SH_JMP_SLOT:
  2583. + *reloc_addr = sym_val;
  2584. + break;
  2585. + case R_SH_RELATIVE:
  2586. + *reloc_addr = (size_t)base_addr + addend;
  2587. + break;
  2588. + case R_SH_DIR32:
  2589. + *reloc_addr = sym_val + addend;
  2590. + break;
  2591. + case R_SH_REL32:
  2592. + *reloc_addr = sym_val + addend - (size_t)reloc_addr + (size_t)base_addr;
  2593. + break;
  2594. + case R_SH_COPY:
  2595. + memcpy(reloc_addr, (void *)sym_val, sym_size);
  2596. + break;
  2597. + case R_SH_TLS_DTPMOD32:
  2598. + *reloc_addr += def.dso ? def.dso->tls_id : self->tls_id;
  2599. + break;
  2600. + case R_SH_TLS_DTPOFF32:
  2601. + *reloc_addr += def.sym->st_value;
  2602. + break;
  2603. + case R_SH_TLS_TPOFF32:
  2604. + *reloc_addr += def.sym
  2605. + ? def.sym->st_value + def.dso->tls_offset + 8
  2606. + : self->tls_offset + 8;
  2607. + break;
  2608. + }
  2609. +}
  2610. diff -Nur musl-0.9.15/arch/sh/src/atomic.c musl-git/arch/sh/src/atomic.c
  2611. --- musl-0.9.15/arch/sh/src/atomic.c 1970-01-01 01:00:00.000000000 +0100
  2612. +++ musl-git/arch/sh/src/atomic.c 2014-03-19 07:42:48.000000000 +0100
  2613. @@ -0,0 +1,146 @@
  2614. +#include "libc.h"
  2615. +
  2616. +#define LLSC_CLOBBERS "r0", "t", "memory"
  2617. +#define LLSC_START(mem) \
  2618. + "0: movli.l @" mem ", r0\n"
  2619. +#define LLSC_END(mem) \
  2620. + "1: movco.l r0, @" mem "\n" \
  2621. + " bf 0b\n" \
  2622. + " synco\n"
  2623. +
  2624. +/* gusa is a hack in the kernel which lets you create a sequence of instructions
  2625. + * which will be restarted if the process is preempted in the middle of the
  2626. + * sequence. It will do for implementing atomics on non-smp systems. ABI is:
  2627. + * r0 = address of first instruction after the atomic sequence
  2628. + * r1 = original stack pointer
  2629. + * r15 = -1 * length of atomic sequence in bytes
  2630. + */
  2631. +#define GUSA_CLOBBERS "r0", "r1", "memory"
  2632. +#define GUSA_START(mem,old,nop) \
  2633. + " .align 2\n" \
  2634. + " mova 1f, r0\n" \
  2635. + nop \
  2636. + " mov r15, r1\n" \
  2637. + " mov #(0f-1f), r15\n" \
  2638. + "0: mov.l @" mem ", " old "\n"
  2639. +/* the target of mova must be 4 byte aligned, so we may need a nop */
  2640. +#define GUSA_START_ODD(mem,old) GUSA_START(mem,old,"")
  2641. +#define GUSA_START_EVEN(mem,old) GUSA_START(mem,old,"\tnop\n")
  2642. +#define GUSA_END(mem,new) \
  2643. + " mov.l " new ", @" mem "\n" \
  2644. + "1: mov r1, r15\n"
  2645. +
  2646. +#define CPU_HAS_LLSC 0x0040
  2647. +
  2648. +int __sh_cas(volatile int *p, int t, int s)
  2649. +{
  2650. + int old;
  2651. + if (__hwcap & CPU_HAS_LLSC) {
  2652. + __asm__ __volatile__(
  2653. + LLSC_START("%1")
  2654. + " mov r0, %0\n"
  2655. + " cmp/eq %0, %2\n"
  2656. + " bf 1f\n"
  2657. + " mov %3, r0\n"
  2658. + LLSC_END("%1")
  2659. + : "=&r"(old) : "r"(p), "r"(t), "r"(s) : LLSC_CLOBBERS);
  2660. + } else {
  2661. + __asm__ __volatile__(
  2662. + GUSA_START_EVEN("%1", "%0")
  2663. + " cmp/eq %0, %2\n"
  2664. + " bf 1f\n"
  2665. + GUSA_END("%1", "%3")
  2666. + : "=&r"(old) : "r"(p), "r"(t), "r"(s) : GUSA_CLOBBERS, "t");
  2667. + }
  2668. + return old;
  2669. +}
  2670. +
  2671. +int __sh_swap(volatile int *x, int v)
  2672. +{
  2673. + int old;
  2674. + if (__hwcap & CPU_HAS_LLSC) {
  2675. + __asm__ __volatile__(
  2676. + LLSC_START("%1")
  2677. + " mov r0, %0\n"
  2678. + " mov %2, r0\n"
  2679. + LLSC_END("%1")
  2680. + : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2681. + } else {
  2682. + __asm__ __volatile__(
  2683. + GUSA_START_EVEN("%1", "%0")
  2684. + GUSA_END("%1", "%2")
  2685. + : "=&r"(old) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2686. + }
  2687. + return old;
  2688. +}
  2689. +
  2690. +int __sh_fetch_add(volatile int *x, int v)
  2691. +{
  2692. + int old, dummy;
  2693. + if (__hwcap & CPU_HAS_LLSC) {
  2694. + __asm__ __volatile__(
  2695. + LLSC_START("%1")
  2696. + " mov r0, %0\n"
  2697. + " add %2, r0\n"
  2698. + LLSC_END("%1")
  2699. + : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2700. + } else {
  2701. + __asm__ __volatile__(
  2702. + GUSA_START_EVEN("%2", "%0")
  2703. + " mov %0, %1\n"
  2704. + " add %3, %1\n"
  2705. + GUSA_END("%2", "%1")
  2706. + : "=&r"(old), "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2707. + }
  2708. + return old;
  2709. +}
  2710. +
  2711. +void __sh_store(volatile int *p, int x)
  2712. +{
  2713. + if (__hwcap & CPU_HAS_LLSC) {
  2714. + __asm__ __volatile__(
  2715. + " mov.l %1, @%0\n"
  2716. + " synco\n"
  2717. + : : "r"(p), "r"(x) : "memory");
  2718. + } else {
  2719. + __asm__ __volatile__(
  2720. + " mov.l %1, @%0\n"
  2721. + : : "r"(p), "r"(x) : "memory");
  2722. + }
  2723. +}
  2724. +
  2725. +void __sh_and(volatile int *x, int v)
  2726. +{
  2727. + int dummy;
  2728. + if (__hwcap & CPU_HAS_LLSC) {
  2729. + __asm__ __volatile__(
  2730. + LLSC_START("%0")
  2731. + " and %1, r0\n"
  2732. + LLSC_END("%0")
  2733. + : : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2734. + } else {
  2735. + __asm__ __volatile__(
  2736. + GUSA_START_ODD("%1", "%0")
  2737. + " and %2, %0\n"
  2738. + GUSA_END("%1", "%0")
  2739. + : "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2740. + }
  2741. +}
  2742. +
  2743. +void __sh_or(volatile int *x, int v)
  2744. +{
  2745. + int dummy;
  2746. + if (__hwcap & CPU_HAS_LLSC) {
  2747. + __asm__ __volatile__(
  2748. + LLSC_START("%0")
  2749. + " or %1, r0\n"
  2750. + LLSC_END("%0")
  2751. + : : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2752. + } else {
  2753. + __asm__ __volatile__(
  2754. + GUSA_START_ODD("%1", "%0")
  2755. + " or %2, %0\n"
  2756. + GUSA_END("%1", "%0")
  2757. + : "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2758. + }
  2759. +}
  2760. diff -Nur musl-0.9.15/arch/sh/src/__fpscr_values.c musl-git/arch/sh/src/__fpscr_values.c
  2761. --- musl-0.9.15/arch/sh/src/__fpscr_values.c 1970-01-01 01:00:00.000000000 +0100
  2762. +++ musl-git/arch/sh/src/__fpscr_values.c 2014-03-19 07:42:48.000000000 +0100
  2763. @@ -0,0 +1,5 @@
  2764. +#include "libc.h"
  2765. +
  2766. +/* used by gcc for switching the FPU between single and double precision */
  2767. +const unsigned long __fpscr_values[2] ATTR_LIBC_VISIBILITY = { 0, 0x80000 };
  2768. +
  2769. diff -Nur musl-0.9.15/arch/sh/syscall_arch.h musl-git/arch/sh/syscall_arch.h
  2770. --- musl-0.9.15/arch/sh/syscall_arch.h 1970-01-01 01:00:00.000000000 +0100
  2771. +++ musl-git/arch/sh/syscall_arch.h 2014-03-19 07:42:48.000000000 +0100
  2772. @@ -0,0 +1,87 @@
  2773. +#define __SYSCALL_LL_E(x) \
  2774. +((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
  2775. +((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  2776. +#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
  2777. +
  2778. +/* The extra OR instructions are to work around a hardware bug:
  2779. + * http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf
  2780. + */
  2781. +#define __asm_syscall(trapno, ...) do { \
  2782. + __asm__ __volatile__ ( \
  2783. + "trapa #" #trapno "\n" \
  2784. + "or r0, r0\n" \
  2785. + "or r0, r0\n" \
  2786. + "or r0, r0\n" \
  2787. + "or r0, r0\n" \
  2788. + "or r0, r0\n" \
  2789. + : "=r"(r0) : __VA_ARGS__ : "memory"); \
  2790. + return r0; \
  2791. + } while (0)
  2792. +
  2793. +static inline long __syscall0(long n)
  2794. +{
  2795. + register long r3 __asm__("r3") = n;
  2796. + register long r0 __asm__("r0");
  2797. + __asm_syscall(16, "r"(r3));
  2798. +}
  2799. +
  2800. +static inline long __syscall1(long n, long a)
  2801. +{
  2802. + register long r3 __asm__("r3") = n;
  2803. + register long r4 __asm__("r4") = a;
  2804. + register long r0 __asm__("r0");
  2805. + __asm_syscall(17, "r"(r3), "r"(r4));
  2806. +}
  2807. +
  2808. +static inline long __syscall2(long n, long a, long b)
  2809. +{
  2810. + register long r3 __asm__("r3") = n;
  2811. + register long r4 __asm__("r4") = a;
  2812. + register long r5 __asm__("r5") = b;
  2813. + register long r0 __asm__("r0");
  2814. + __asm_syscall(18, "r"(r3), "r"(r4), "r"(r5));
  2815. +}
  2816. +
  2817. +static inline long __syscall3(long n, long a, long b, long c)
  2818. +{
  2819. + register long r3 __asm__("r3") = n;
  2820. + register long r4 __asm__("r4") = a;
  2821. + register long r5 __asm__("r5") = b;
  2822. + register long r6 __asm__("r6") = c;
  2823. + register long r0 __asm__("r0");
  2824. + __asm_syscall(19, "r"(r3), "r"(r4), "r"(r5), "r"(r6));
  2825. +}
  2826. +
  2827. +static inline long __syscall4(long n, long a, long b, long c, long d)
  2828. +{
  2829. + register long r3 __asm__("r3") = n;
  2830. + register long r4 __asm__("r4") = a;
  2831. + register long r5 __asm__("r5") = b;
  2832. + register long r6 __asm__("r6") = c;
  2833. + register long r7 __asm__("r7") = d;
  2834. + register long r0 __asm__("r0");
  2835. + __asm_syscall(20, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7));
  2836. +}
  2837. +
  2838. +static inline long __syscall5(long n, long a, long b, long c, long d, long e)
  2839. +{
  2840. + register long r3 __asm__("r3") = n;
  2841. + register long r4 __asm__("r4") = a;
  2842. + register long r5 __asm__("r5") = b;
  2843. + register long r6 __asm__("r6") = c;
  2844. + register long r7 __asm__("r7") = d;
  2845. + register long r0 __asm__("r0") = e;
  2846. + __asm_syscall(21, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0));
  2847. +}
  2848. +
  2849. +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
  2850. +{
  2851. + register long r3 __asm__("r3") = n;
  2852. + register long r4 __asm__("r4") = a;
  2853. + register long r5 __asm__("r5") = b;
  2854. + register long r6 __asm__("r6") = c;
  2855. + register long r7 __asm__("r7") = d;
  2856. + register long r0 __asm__("r0") = e;
  2857. + register long r1 __asm__("r1") = f;
  2858. + __asm_syscall(22, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0), "r"(r1));
  2859. +}
  2860. diff -Nur musl-0.9.15/arch/x32/atomic.h musl-git/arch/x32/atomic.h
  2861. --- musl-0.9.15/arch/x32/atomic.h 1970-01-01 01:00:00.000000000 +0100
  2862. +++ musl-git/arch/x32/atomic.h 2014-03-19 07:42:48.000000000 +0100
  2863. @@ -0,0 +1,125 @@
  2864. +#ifndef _INTERNAL_ATOMIC_H
  2865. +#define _INTERNAL_ATOMIC_H
  2866. +
  2867. +#include <stdint.h>
  2868. +
  2869. +static inline int a_ctz_64(uint64_t x)
  2870. +{
  2871. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  2872. + return x;
  2873. +}
  2874. +
  2875. +static inline int a_ctz_l(unsigned long x)
  2876. +{
  2877. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  2878. + return x;
  2879. +}
  2880. +
  2881. +static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  2882. +{
  2883. + __asm__( "lock ; and %1, %0"
  2884. + : "=m"(*p) : "r"(v) : "memory" );
  2885. +}
  2886. +
  2887. +static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  2888. +{
  2889. + __asm__( "lock ; or %1, %0"
  2890. + : "=m"(*p) : "r"(v) : "memory" );
  2891. +}
  2892. +
  2893. +static inline void a_store_l(volatile void *p, long x)
  2894. +{
  2895. + __asm__( "mov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  2896. +}
  2897. +
  2898. +static inline void a_or_l(volatile void *p, long v)
  2899. +{
  2900. + __asm__( "lock ; or %1, %0"
  2901. + : "=m"(*(long *)p) : "r"(v) : "memory" );
  2902. +}
  2903. +
  2904. +static inline void *a_cas_p(volatile void *p, void *t, void *s)
  2905. +{
  2906. + __asm__( "lock ; cmpxchg %3, %1"
  2907. + : "=a"(t), "=m"(*(long *)p) : "a"(t), "r"(s) : "memory" );
  2908. + return t;
  2909. +}
  2910. +
  2911. +static inline long a_cas_l(volatile void *p, long t, long s)
  2912. +{
  2913. + __asm__( "lock ; cmpxchg %3, %1"
  2914. + : "=a"(t), "=m"(*(long *)p) : "a"(t), "r"(s) : "memory" );
  2915. + return t;
  2916. +}
  2917. +
  2918. +static inline int a_cas(volatile int *p, int t, int s)
  2919. +{
  2920. + __asm__( "lock ; cmpxchg %3, %1"
  2921. + : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
  2922. + return t;
  2923. +}
  2924. +
  2925. +static inline void *a_swap_p(void *volatile *x, void *v)
  2926. +{
  2927. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*(void **)x) : "0"(v) : "memory" );
  2928. + return v;
  2929. +}
  2930. +static inline long a_swap_l(volatile void *x, long v)
  2931. +{
  2932. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*(long *)x) : "0"(v) : "memory" );
  2933. + return v;
  2934. +}
  2935. +
  2936. +static inline void a_or(volatile void *p, int v)
  2937. +{
  2938. + __asm__( "lock ; or %1, %0"
  2939. + : "=m"(*(int *)p) : "r"(v) : "memory" );
  2940. +}
  2941. +
  2942. +static inline void a_and(volatile void *p, int v)
  2943. +{
  2944. + __asm__( "lock ; and %1, %0"
  2945. + : "=m"(*(int *)p) : "r"(v) : "memory" );
  2946. +}
  2947. +
  2948. +static inline int a_swap(volatile int *x, int v)
  2949. +{
  2950. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*x) : "0"(v) : "memory" );
  2951. + return v;
  2952. +}
  2953. +
  2954. +#define a_xchg a_swap
  2955. +
  2956. +static inline int a_fetch_add(volatile int *x, int v)
  2957. +{
  2958. + __asm__( "lock ; xadd %0, %1" : "=r"(v), "=m"(*x) : "0"(v) : "memory" );
  2959. + return v;
  2960. +}
  2961. +
  2962. +static inline void a_inc(volatile int *x)
  2963. +{
  2964. + __asm__( "lock ; incl %0" : "=m"(*x) : "m"(*x) : "memory" );
  2965. +}
  2966. +
  2967. +static inline void a_dec(volatile int *x)
  2968. +{
  2969. + __asm__( "lock ; decl %0" : "=m"(*x) : "m"(*x) : "memory" );
  2970. +}
  2971. +
  2972. +static inline void a_store(volatile int *p, int x)
  2973. +{
  2974. + __asm__( "mov %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  2975. +}
  2976. +
  2977. +static inline void a_spin()
  2978. +{
  2979. + __asm__ __volatile__( "pause" : : : "memory" );
  2980. +}
  2981. +
  2982. +static inline void a_crash()
  2983. +{
  2984. + __asm__ __volatile__( "hlt" : : : "memory" );
  2985. +}
  2986. +
  2987. +
  2988. +#endif
  2989. diff -Nur musl-0.9.15/arch/x32/bits/alltypes.h.in musl-git/arch/x32/bits/alltypes.h.in
  2990. --- musl-0.9.15/arch/x32/bits/alltypes.h.in 1970-01-01 01:00:00.000000000 +0100
  2991. +++ musl-git/arch/x32/bits/alltypes.h.in 2014-03-19 07:42:48.000000000 +0100
  2992. @@ -0,0 +1,28 @@
  2993. +#define _Addr int
  2994. +#define _Int64 long long
  2995. +#define _Reg long long
  2996. +
  2997. +TYPEDEF __builtin_va_list va_list;
  2998. +TYPEDEF __builtin_va_list __isoc_va_list;
  2999. +
  3000. +#ifndef __cplusplus
  3001. +TYPEDEF long wchar_t;
  3002. +#endif
  3003. +TYPEDEF unsigned wint_t;
  3004. +
  3005. +#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
  3006. +TYPEDEF long double float_t;
  3007. +TYPEDEF long double double_t;
  3008. +#else
  3009. +TYPEDEF float float_t;
  3010. +TYPEDEF double double_t;
  3011. +#endif
  3012. +
  3013. +TYPEDEF long long time_t;
  3014. +TYPEDEF long long suseconds_t;
  3015. +
  3016. +TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
  3017. +TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t;
  3018. +TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t;
  3019. +TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t;
  3020. +TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t;
  3021. diff -Nur musl-0.9.15/arch/x32/bits/endian.h musl-git/arch/x32/bits/endian.h
  3022. --- musl-0.9.15/arch/x32/bits/endian.h 1970-01-01 01:00:00.000000000 +0100
  3023. +++ musl-git/arch/x32/bits/endian.h 2014-03-19 07:42:48.000000000 +0100
  3024. @@ -0,0 +1 @@
  3025. +#define __BYTE_ORDER __LITTLE_ENDIAN
  3026. diff -Nur musl-0.9.15/arch/x32/bits/errno.h musl-git/arch/x32/bits/errno.h
  3027. --- musl-0.9.15/arch/x32/bits/errno.h 1970-01-01 01:00:00.000000000 +0100
  3028. +++ musl-git/arch/x32/bits/errno.h 2014-03-19 07:42:48.000000000 +0100
  3029. @@ -0,0 +1,134 @@
  3030. +#define EPERM 1
  3031. +#define ENOENT 2
  3032. +#define ESRCH 3
  3033. +#define EINTR 4
  3034. +#define EIO 5
  3035. +#define ENXIO 6
  3036. +#define E2BIG 7
  3037. +#define ENOEXEC 8
  3038. +#define EBADF 9
  3039. +#define ECHILD 10
  3040. +#define EAGAIN 11
  3041. +#define ENOMEM 12
  3042. +#define EACCES 13
  3043. +#define EFAULT 14
  3044. +#define ENOTBLK 15
  3045. +#define EBUSY 16
  3046. +#define EEXIST 17
  3047. +#define EXDEV 18
  3048. +#define ENODEV 19
  3049. +#define ENOTDIR 20
  3050. +#define EISDIR 21
  3051. +#define EINVAL 22
  3052. +#define ENFILE 23
  3053. +#define EMFILE 24
  3054. +#define ENOTTY 25
  3055. +#define ETXTBSY 26
  3056. +#define EFBIG 27
  3057. +#define ENOSPC 28
  3058. +#define ESPIPE 29
  3059. +#define EROFS 30
  3060. +#define EMLINK 31
  3061. +#define EPIPE 32
  3062. +#define EDOM 33
  3063. +#define ERANGE 34
  3064. +#define EDEADLK 35
  3065. +#define ENAMETOOLONG 36
  3066. +#define ENOLCK 37
  3067. +#define ENOSYS 38
  3068. +#define ENOTEMPTY 39
  3069. +#define ELOOP 40
  3070. +#define EWOULDBLOCK EAGAIN
  3071. +#define ENOMSG 42
  3072. +#define EIDRM 43
  3073. +#define ECHRNG 44
  3074. +#define EL2NSYNC 45
  3075. +#define EL3HLT 46
  3076. +#define EL3RST 47
  3077. +#define ELNRNG 48
  3078. +#define EUNATCH 49
  3079. +#define ENOCSI 50
  3080. +#define EL2HLT 51
  3081. +#define EBADE 52
  3082. +#define EBADR 53
  3083. +#define EXFULL 54
  3084. +#define ENOANO 55
  3085. +#define EBADRQC 56
  3086. +#define EBADSLT 57
  3087. +#define EDEADLOCK EDEADLK
  3088. +#define EBFONT 59
  3089. +#define ENOSTR 60
  3090. +#define ENODATA 61
  3091. +#define ETIME 62
  3092. +#define ENOSR 63
  3093. +#define ENONET 64
  3094. +#define ENOPKG 65
  3095. +#define EREMOTE 66
  3096. +#define ENOLINK 67
  3097. +#define EADV 68
  3098. +#define ESRMNT 69
  3099. +#define ECOMM 70
  3100. +#define EPROTO 71
  3101. +#define EMULTIHOP 72
  3102. +#define EDOTDOT 73
  3103. +#define EBADMSG 74
  3104. +#define EOVERFLOW 75
  3105. +#define ENOTUNIQ 76
  3106. +#define EBADFD 77
  3107. +#define EREMCHG 78
  3108. +#define ELIBACC 79
  3109. +#define ELIBBAD 80
  3110. +#define ELIBSCN 81
  3111. +#define ELIBMAX 82
  3112. +#define ELIBEXEC 83
  3113. +#define EILSEQ 84
  3114. +#define ERESTART 85
  3115. +#define ESTRPIPE 86
  3116. +#define EUSERS 87
  3117. +#define ENOTSOCK 88
  3118. +#define EDESTADDRREQ 89
  3119. +#define EMSGSIZE 90
  3120. +#define EPROTOTYPE 91
  3121. +#define ENOPROTOOPT 92
  3122. +#define EPROTONOSUPPORT 93
  3123. +#define ESOCKTNOSUPPORT 94
  3124. +#define EOPNOTSUPP 95
  3125. +#define ENOTSUP EOPNOTSUPP
  3126. +#define EPFNOSUPPORT 96
  3127. +#define EAFNOSUPPORT 97
  3128. +#define EADDRINUSE 98
  3129. +#define EADDRNOTAVAIL 99
  3130. +#define ENETDOWN 100
  3131. +#define ENETUNREACH 101
  3132. +#define ENETRESET 102
  3133. +#define ECONNABORTED 103
  3134. +#define ECONNRESET 104
  3135. +#define ENOBUFS 105
  3136. +#define EISCONN 106
  3137. +#define ENOTCONN 107
  3138. +#define ESHUTDOWN 108
  3139. +#define ETOOMANYREFS 109
  3140. +#define ETIMEDOUT 110
  3141. +#define ECONNREFUSED 111
  3142. +#define EHOSTDOWN 112
  3143. +#define EHOSTUNREACH 113
  3144. +#define EALREADY 114
  3145. +#define EINPROGRESS 115
  3146. +#define ESTALE 116
  3147. +#define EUCLEAN 117
  3148. +#define ENOTNAM 118
  3149. +#define ENAVAIL 119
  3150. +#define EISNAM 120
  3151. +#define EREMOTEIO 121
  3152. +#define EDQUOT 122
  3153. +#define ENOMEDIUM 123
  3154. +#define EMEDIUMTYPE 124
  3155. +#define ECANCELED 125
  3156. +#define ENOKEY 126
  3157. +#define EKEYEXPIRED 127
  3158. +#define EKEYREVOKED 128
  3159. +#define EKEYREJECTED 129
  3160. +#define EOWNERDEAD 130
  3161. +#define ENOTRECOVERABLE 131
  3162. +#define ERFKILL 132
  3163. +#define EHWPOISON 133
  3164. diff -Nur musl-0.9.15/arch/x32/bits/fcntl.h musl-git/arch/x32/bits/fcntl.h
  3165. --- musl-0.9.15/arch/x32/bits/fcntl.h 1970-01-01 01:00:00.000000000 +0100
  3166. +++ musl-git/arch/x32/bits/fcntl.h 2014-03-19 07:42:48.000000000 +0100
  3167. @@ -0,0 +1,39 @@
  3168. +#define O_CREAT 0100
  3169. +#define O_EXCL 0200
  3170. +#define O_NOCTTY 0400
  3171. +#define O_TRUNC 01000
  3172. +#define O_APPEND 02000
  3173. +#define O_NONBLOCK 04000
  3174. +#define O_DSYNC 010000
  3175. +#define O_SYNC 04010000
  3176. +#define O_RSYNC 04010000
  3177. +#define O_DIRECTORY 0200000
  3178. +#define O_NOFOLLOW 0400000
  3179. +#define O_CLOEXEC 02000000
  3180. +
  3181. +#define O_ASYNC 020000
  3182. +#define O_DIRECT 040000
  3183. +#define O_LARGEFILE 0
  3184. +#define O_NOATIME 01000000
  3185. +#define O_TMPFILE 020200000
  3186. +#define O_NDELAY O_NONBLOCK
  3187. +
  3188. +#define F_DUPFD 0
  3189. +#define F_GETFD 1
  3190. +#define F_SETFD 2
  3191. +#define F_GETFL 3
  3192. +#define F_SETFL 4
  3193. +
  3194. +#define F_SETOWN 8
  3195. +#define F_GETOWN 9
  3196. +#define F_SETSIG 10
  3197. +#define F_GETSIG 11
  3198. +
  3199. +#define F_GETLK 5
  3200. +#define F_SETLK 6
  3201. +#define F_SETLKW 7
  3202. +
  3203. +#define F_SETOWN_EX 15
  3204. +#define F_GETOWN_EX 16
  3205. +
  3206. +#define F_GETOWNER_UIDS 17
  3207. diff -Nur musl-0.9.15/arch/x32/bits/fenv.h musl-git/arch/x32/bits/fenv.h
  3208. --- musl-0.9.15/arch/x32/bits/fenv.h 1970-01-01 01:00:00.000000000 +0100
  3209. +++ musl-git/arch/x32/bits/fenv.h 2014-03-19 07:42:48.000000000 +0100
  3210. @@ -0,0 +1,34 @@
  3211. +#define FE_INVALID 1
  3212. +#define __FE_DENORM 2
  3213. +#define FE_DIVBYZERO 4
  3214. +#define FE_OVERFLOW 8
  3215. +#define FE_UNDERFLOW 16
  3216. +#define FE_INEXACT 32
  3217. +
  3218. +#define FE_ALL_EXCEPT 63
  3219. +
  3220. +#define FE_TONEAREST 0
  3221. +#define FE_DOWNWARD 0x400
  3222. +#define FE_UPWARD 0x800
  3223. +#define FE_TOWARDZERO 0xc00
  3224. +
  3225. +typedef unsigned short fexcept_t;
  3226. +
  3227. +typedef struct {
  3228. + unsigned short __control_word;
  3229. + unsigned short __unused1;
  3230. + unsigned short __status_word;
  3231. + unsigned short __unused2;
  3232. + unsigned short __tags;
  3233. + unsigned short __unused3;
  3234. + unsigned int __eip;
  3235. + unsigned short __cs_selector;
  3236. + unsigned int __opcode:11;
  3237. + unsigned int __unused4:5;
  3238. + unsigned int __data_offset;
  3239. + unsigned short __data_selector;
  3240. + unsigned short __unused5;
  3241. + unsigned int __mxcsr;
  3242. +} fenv_t;
  3243. +
  3244. +#define FE_DFL_ENV ((const fenv_t *) -1)
  3245. diff -Nur musl-0.9.15/arch/x32/bits/float.h musl-git/arch/x32/bits/float.h
  3246. --- musl-0.9.15/arch/x32/bits/float.h 1970-01-01 01:00:00.000000000 +0100
  3247. +++ musl-git/arch/x32/bits/float.h 2014-03-19 07:42:48.000000000 +0100
  3248. @@ -0,0 +1,21 @@
  3249. +#define FLT_ROUNDS 1
  3250. +#ifdef __FLT_EVAL_METHOD__
  3251. +#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
  3252. +#else
  3253. +#define FLT_EVAL_METHOD 0
  3254. +#endif
  3255. +
  3256. +#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
  3257. +#define LDBL_MIN 3.3621031431120935063e-4932L
  3258. +#define LDBL_MAX 1.1897314953572317650e+4932L
  3259. +#define LDBL_EPSILON 1.0842021724855044340e-19L
  3260. +
  3261. +#define LDBL_MANT_DIG 64
  3262. +#define LDBL_MIN_EXP (-16381)
  3263. +#define LDBL_MAX_EXP 16384
  3264. +
  3265. +#define LDBL_DIG 18
  3266. +#define LDBL_MIN_10_EXP (-4931)
  3267. +#define LDBL_MAX_10_EXP 4932
  3268. +
  3269. +#define DECIMAL_DIG 21
  3270. diff -Nur musl-0.9.15/arch/x32/bits/ioctl.h musl-git/arch/x32/bits/ioctl.h
  3271. --- musl-0.9.15/arch/x32/bits/ioctl.h 1970-01-01 01:00:00.000000000 +0100
  3272. +++ musl-git/arch/x32/bits/ioctl.h 2014-03-19 07:42:48.000000000 +0100
  3273. @@ -0,0 +1,197 @@
  3274. +#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
  3275. +#define _IOC_NONE 0U
  3276. +#define _IOC_WRITE 1U
  3277. +#define _IOC_READ 2U
  3278. +
  3279. +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
  3280. +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
  3281. +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
  3282. +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
  3283. +
  3284. +#define TCGETS 0x5401
  3285. +#define TCSETS 0x5402
  3286. +#define TCSETSW 0x5403
  3287. +#define TCSETSF 0x5404
  3288. +#define TCGETA 0x5405
  3289. +#define TCSETA 0x5406
  3290. +#define TCSETAW 0x5407
  3291. +#define TCSETAF 0x5408
  3292. +#define TCSBRK 0x5409
  3293. +#define TCXONC 0x540A
  3294. +#define TCFLSH 0x540B
  3295. +#define TIOCEXCL 0x540C
  3296. +#define TIOCNXCL 0x540D
  3297. +#define TIOCSCTTY 0x540E
  3298. +#define TIOCGPGRP 0x540F
  3299. +#define TIOCSPGRP 0x5410
  3300. +#define TIOCOUTQ 0x5411
  3301. +#define TIOCSTI 0x5412
  3302. +#define TIOCGWINSZ 0x5413
  3303. +#define TIOCSWINSZ 0x5414
  3304. +#define TIOCMGET 0x5415
  3305. +#define TIOCMBIS 0x5416
  3306. +#define TIOCMBIC 0x5417
  3307. +#define TIOCMSET 0x5418
  3308. +#define TIOCGSOFTCAR 0x5419
  3309. +#define TIOCSSOFTCAR 0x541A
  3310. +#define FIONREAD 0x541B
  3311. +#define TIOCINQ FIONREAD
  3312. +#define TIOCLINUX 0x541C
  3313. +#define TIOCCONS 0x541D
  3314. +#define TIOCGSERIAL 0x541E
  3315. +#define TIOCSSERIAL 0x541F
  3316. +#define TIOCPKT 0x5420
  3317. +#define FIONBIO 0x5421
  3318. +#define TIOCNOTTY 0x5422
  3319. +#define TIOCSETD 0x5423
  3320. +#define TIOCGETD 0x5424
  3321. +#define TCSBRKP 0x5425
  3322. +#define TIOCTTYGSTRUCT 0x5426
  3323. +#define TIOCSBRK 0x5427
  3324. +#define TIOCCBRK 0x5428
  3325. +#define TIOCGSID 0x5429
  3326. +#define TIOCGPTN 0x80045430
  3327. +#define TIOCSPTLCK 0x40045431
  3328. +#define TCGETX 0x5432
  3329. +#define TCSETX 0x5433
  3330. +#define TCSETXF 0x5434
  3331. +#define TCSETXW 0x5435
  3332. +
  3333. +#define FIONCLEX 0x5450
  3334. +#define FIOCLEX 0x5451
  3335. +#define FIOASYNC 0x5452
  3336. +#define TIOCSERCONFIG 0x5453
  3337. +#define TIOCSERGWILD 0x5454
  3338. +#define TIOCSERSWILD 0x5455
  3339. +#define TIOCGLCKTRMIOS 0x5456
  3340. +#define TIOCSLCKTRMIOS 0x5457
  3341. +#define TIOCSERGSTRUCT 0x5458
  3342. +#define TIOCSERGETLSR 0x5459
  3343. +#define TIOCSERGETMULTI 0x545A
  3344. +#define TIOCSERSETMULTI 0x545B
  3345. +
  3346. +#define TIOCMIWAIT 0x545C
  3347. +#define TIOCGICOUNT 0x545D
  3348. +#define TIOCGHAYESESP 0x545E
  3349. +#define TIOCSHAYESESP 0x545F
  3350. +#define FIOQSIZE 0x5460
  3351. +
  3352. +#define TIOCPKT_DATA 0
  3353. +#define TIOCPKT_FLUSHREAD 1
  3354. +#define TIOCPKT_FLUSHWRITE 2
  3355. +#define TIOCPKT_STOP 4
  3356. +#define TIOCPKT_START 8
  3357. +#define TIOCPKT_NOSTOP 16
  3358. +#define TIOCPKT_DOSTOP 32
  3359. +#define TIOCPKT_IOCTL 64
  3360. +
  3361. +#define TIOCSER_TEMT 0x01
  3362. +
  3363. +struct winsize {
  3364. + unsigned short ws_row;
  3365. + unsigned short ws_col;
  3366. + unsigned short ws_xpixel;
  3367. + unsigned short ws_ypixel;
  3368. +};
  3369. +
  3370. +#define TIOCM_LE 0x001
  3371. +#define TIOCM_DTR 0x002
  3372. +#define TIOCM_RTS 0x004
  3373. +#define TIOCM_ST 0x008
  3374. +#define TIOCM_SR 0x010
  3375. +#define TIOCM_CTS 0x020
  3376. +#define TIOCM_CAR 0x040
  3377. +#define TIOCM_RNG 0x080
  3378. +#define TIOCM_DSR 0x100
  3379. +#define TIOCM_CD TIOCM_CAR
  3380. +#define TIOCM_RI TIOCM_RNG
  3381. +#define TIOCM_OUT1 0x2000
  3382. +#define TIOCM_OUT2 0x4000
  3383. +#define TIOCM_LOOP 0x8000
  3384. +#define TIOCM_MODEM_BITS TIOCM_OUT2
  3385. +
  3386. +#define N_TTY 0
  3387. +#define N_SLIP 1
  3388. +#define N_MOUSE 2
  3389. +#define N_PPP 3
  3390. +#define N_STRIP 4
  3391. +#define N_AX25 5
  3392. +#define N_X25 6
  3393. +#define N_6PACK 7
  3394. +#define N_MASC 8
  3395. +#define N_R3964 9
  3396. +#define N_PROFIBUS_FDL 10
  3397. +#define N_IRDA 11
  3398. +#define N_SMSBLOCK 12
  3399. +#define N_HDLC 13
  3400. +#define N_SYNC_PPP 14
  3401. +#define N_HCI 15
  3402. +
  3403. +#define FIOSETOWN 0x8901
  3404. +#define SIOCSPGRP 0x8902
  3405. +#define FIOGETOWN 0x8903
  3406. +#define SIOCGPGRP 0x8904
  3407. +#define SIOCATMARK 0x8905
  3408. +#define SIOCGSTAMP 0x8906
  3409. +
  3410. +#define SIOCADDRT 0x890B
  3411. +#define SIOCDELRT 0x890C
  3412. +#define SIOCRTMSG 0x890D
  3413. +
  3414. +#define SIOCGIFNAME 0x8910
  3415. +#define SIOCSIFLINK 0x8911
  3416. +#define SIOCGIFCONF 0x8912
  3417. +#define SIOCGIFFLAGS 0x8913
  3418. +#define SIOCSIFFLAGS 0x8914
  3419. +#define SIOCGIFADDR 0x8915
  3420. +#define SIOCSIFADDR 0x8916
  3421. +#define SIOCGIFDSTADDR 0x8917
  3422. +#define SIOCSIFDSTADDR 0x8918
  3423. +#define SIOCGIFBRDADDR 0x8919
  3424. +#define SIOCSIFBRDADDR 0x891a
  3425. +#define SIOCGIFNETMASK 0x891b
  3426. +#define SIOCSIFNETMASK 0x891c
  3427. +#define SIOCGIFMETRIC 0x891d
  3428. +#define SIOCSIFMETRIC 0x891e
  3429. +#define SIOCGIFMEM 0x891f
  3430. +#define SIOCSIFMEM 0x8920
  3431. +#define SIOCGIFMTU 0x8921
  3432. +#define SIOCSIFMTU 0x8922
  3433. +#define SIOCSIFHWADDR 0x8924
  3434. +#define SIOCGIFENCAP 0x8925
  3435. +#define SIOCSIFENCAP 0x8926
  3436. +#define SIOCGIFHWADDR 0x8927
  3437. +#define SIOCGIFSLAVE 0x8929
  3438. +#define SIOCSIFSLAVE 0x8930
  3439. +#define SIOCADDMULTI 0x8931
  3440. +#define SIOCDELMULTI 0x8932
  3441. +#define SIOCGIFINDEX 0x8933
  3442. +#define SIOGIFINDEX SIOCGIFINDEX
  3443. +#define SIOCSIFPFLAGS 0x8934
  3444. +#define SIOCGIFPFLAGS 0x8935
  3445. +#define SIOCDIFADDR 0x8936
  3446. +#define SIOCSIFHWBROADCAST 0x8937
  3447. +#define SIOCGIFCOUNT 0x8938
  3448. +
  3449. +#define SIOCGIFBR 0x8940
  3450. +#define SIOCSIFBR 0x8941
  3451. +
  3452. +#define SIOCGIFTXQLEN 0x8942
  3453. +#define SIOCSIFTXQLEN 0x8943
  3454. +
  3455. +#define SIOCDARP 0x8953
  3456. +#define SIOCGARP 0x8954
  3457. +#define SIOCSARP 0x8955
  3458. +
  3459. +#define SIOCDRARP 0x8960
  3460. +#define SIOCGRARP 0x8961
  3461. +#define SIOCSRARP 0x8962
  3462. +
  3463. +#define SIOCGIFMAP 0x8970
  3464. +#define SIOCSIFMAP 0x8971
  3465. +
  3466. +#define SIOCADDDLCI 0x8980
  3467. +#define SIOCDELDLCI 0x8981
  3468. +
  3469. +#define SIOCDEVPRIVATE 0x89F0
  3470. +#define SIOCPROTOPRIVATE 0x89E0
  3471. diff -Nur musl-0.9.15/arch/x32/bits/io.h musl-git/arch/x32/bits/io.h
  3472. --- musl-0.9.15/arch/x32/bits/io.h 1970-01-01 01:00:00.000000000 +0100
  3473. +++ musl-git/arch/x32/bits/io.h 2014-03-19 07:42:48.000000000 +0100
  3474. @@ -0,0 +1,77 @@
  3475. +static __inline void outb(unsigned char __val, unsigned short __port)
  3476. +{
  3477. + __asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
  3478. +}
  3479. +
  3480. +static __inline void outw(unsigned short __val, unsigned short __port)
  3481. +{
  3482. + __asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
  3483. +}
  3484. +
  3485. +static __inline void outl(unsigned int __val, unsigned short __port)
  3486. +{
  3487. + __asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
  3488. +}
  3489. +
  3490. +static __inline unsigned char inb(unsigned short __port)
  3491. +{
  3492. + unsigned char __val;
  3493. + __asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
  3494. + return __val;
  3495. +}
  3496. +
  3497. +static __inline unsigned short inw(unsigned short __port)
  3498. +{
  3499. + unsigned short __val;
  3500. + __asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
  3501. + return __val;
  3502. +}
  3503. +
  3504. +static __inline unsigned int inl(unsigned short __port)
  3505. +{
  3506. + unsigned int __val;
  3507. + __asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
  3508. + return __val;
  3509. +}
  3510. +
  3511. +static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
  3512. +{
  3513. + __asm__ volatile ("cld; rep; outsb"
  3514. + : "+S" (__buf), "+c" (__n)
  3515. + : "d" (__port));
  3516. +}
  3517. +
  3518. +static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
  3519. +{
  3520. + __asm__ volatile ("cld; rep; outsw"
  3521. + : "+S" (__buf), "+c" (__n)
  3522. + : "d" (__port));
  3523. +}
  3524. +
  3525. +static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
  3526. +{
  3527. + __asm__ volatile ("cld; rep; outsl"
  3528. + : "+S" (__buf), "+c"(__n)
  3529. + : "d" (__port));
  3530. +}
  3531. +
  3532. +static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
  3533. +{
  3534. + __asm__ volatile ("cld; rep; insb"
  3535. + : "+D" (__buf), "+c" (__n)
  3536. + : "d" (__port));
  3537. +}
  3538. +
  3539. +static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
  3540. +{
  3541. + __asm__ volatile ("cld; rep; insw"
  3542. + : "+D" (__buf), "+c" (__n)
  3543. + : "d" (__port));
  3544. +}
  3545. +
  3546. +static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
  3547. +{
  3548. + __asm__ volatile ("cld; rep; insl"
  3549. + : "+D" (__buf), "+c" (__n)
  3550. + : "d" (__port));
  3551. +}
  3552. diff -Nur musl-0.9.15/arch/x32/bits/ipc.h musl-git/arch/x32/bits/ipc.h
  3553. --- musl-0.9.15/arch/x32/bits/ipc.h 1970-01-01 01:00:00.000000000 +0100
  3554. +++ musl-git/arch/x32/bits/ipc.h 2014-03-19 07:42:48.000000000 +0100
  3555. @@ -0,0 +1,14 @@
  3556. +struct ipc_perm
  3557. +{
  3558. + key_t __ipc_perm_key;
  3559. + uid_t uid;
  3560. + gid_t gid;
  3561. + uid_t cuid;
  3562. + gid_t cgid;
  3563. + mode_t mode;
  3564. + int __ipc_perm_seq;
  3565. + long long __pad1;
  3566. + long long __pad2;
  3567. +};
  3568. +
  3569. +#define IPC_64 0
  3570. diff -Nur musl-0.9.15/arch/x32/bits/limits.h musl-git/arch/x32/bits/limits.h
  3571. --- musl-0.9.15/arch/x32/bits/limits.h 1970-01-01 01:00:00.000000000 +0100
  3572. +++ musl-git/arch/x32/bits/limits.h 2014-03-19 07:42:48.000000000 +0100
  3573. @@ -0,0 +1,8 @@
  3574. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  3575. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3576. +#define PAGE_SIZE 4096
  3577. +#define LONG_BIT 32
  3578. +#endif
  3579. +
  3580. +#define LONG_MAX 0x7fffffffL
  3581. +#define LLONG_MAX 0x7fffffffffffffffLL
  3582. diff -Nur musl-0.9.15/arch/x32/bits/mman.h musl-git/arch/x32/bits/mman.h
  3583. --- musl-0.9.15/arch/x32/bits/mman.h 1970-01-01 01:00:00.000000000 +0100
  3584. +++ musl-git/arch/x32/bits/mman.h 2014-03-19 07:42:48.000000000 +0100
  3585. @@ -0,0 +1,62 @@
  3586. +#define MAP_FAILED ((void *) -1)
  3587. +
  3588. +#define PROT_NONE 0
  3589. +#define PROT_READ 1
  3590. +#define PROT_WRITE 2
  3591. +#define PROT_EXEC 4
  3592. +#define PROT_GROWSDOWN 0x01000000
  3593. +#define PROT_GROWSUP 0x02000000
  3594. +
  3595. +#define MAP_SHARED 0x01
  3596. +#define MAP_PRIVATE 0x02
  3597. +#define MAP_FIXED 0x10
  3598. +
  3599. +#define MAP_TYPE 0x0f
  3600. +#define MAP_FILE 0x00
  3601. +#define MAP_ANON 0x20
  3602. +#define MAP_ANONYMOUS MAP_ANON
  3603. +#define MAP_32BIT 0x40
  3604. +#define MAP_NORESERVE 0x4000
  3605. +#define MAP_GROWSDOWN 0x0100
  3606. +#define MAP_DENYWRITE 0x0800
  3607. +#define MAP_EXECUTABLE 0x1000
  3608. +#define MAP_LOCKED 0x2000
  3609. +#define MAP_POPULATE 0x8000
  3610. +#define MAP_NONBLOCK 0x10000
  3611. +#define MAP_STACK 0x20000
  3612. +#define MAP_HUGETLB 0x40000
  3613. +
  3614. +#define POSIX_MADV_NORMAL 0
  3615. +#define POSIX_MADV_RANDOM 1
  3616. +#define POSIX_MADV_SEQUENTIAL 2
  3617. +#define POSIX_MADV_WILLNEED 3
  3618. +#define POSIX_MADV_DONTNEED 0
  3619. +
  3620. +#define MS_ASYNC 1
  3621. +#define MS_INVALIDATE 2
  3622. +#define MS_SYNC 4
  3623. +
  3624. +#define MCL_CURRENT 1
  3625. +#define MCL_FUTURE 2
  3626. +
  3627. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3628. +#define MADV_NORMAL 0
  3629. +#define MADV_RANDOM 1
  3630. +#define MADV_SEQUENTIAL 2
  3631. +#define MADV_WILLNEED 3
  3632. +#define MADV_DONTNEED 4
  3633. +#define MADV_REMOVE 9
  3634. +#define MADV_DONTFORK 10
  3635. +#define MADV_DOFORK 11
  3636. +#define MADV_MERGEABLE 12
  3637. +#define MADV_UNMERGEABLE 13
  3638. +#define MADV_HUGEPAGE 14
  3639. +#define MADV_NOHUGEPAGE 15
  3640. +#define MADV_DONTDUMP 16
  3641. +#define MADV_DODUMP 17
  3642. +#define MADV_HWPOISON 100
  3643. +#define MADV_SOFT_OFFLINE 101
  3644. +
  3645. +#define MREMAP_MAYMOVE 1
  3646. +#define MREMAP_FIXED 2
  3647. +#endif
  3648. diff -Nur musl-0.9.15/arch/x32/bits/msg.h musl-git/arch/x32/bits/msg.h
  3649. --- musl-0.9.15/arch/x32/bits/msg.h 1970-01-01 01:00:00.000000000 +0100
  3650. +++ musl-git/arch/x32/bits/msg.h 2014-03-19 07:42:48.000000000 +0100
  3651. @@ -0,0 +1,16 @@
  3652. +struct msqid_ds
  3653. +{
  3654. + struct ipc_perm msg_perm;
  3655. + time_t msg_stime;
  3656. + time_t msg_rtime;
  3657. + time_t msg_ctime;
  3658. + unsigned long msg_cbytes;
  3659. + long __unused1;
  3660. + msgqnum_t msg_qnum;
  3661. + long __unused2;
  3662. + msglen_t msg_qbytes;
  3663. + long __unused3;
  3664. + pid_t msg_lspid;
  3665. + pid_t msg_lrpid;
  3666. + unsigned long long __unused[2];
  3667. +};
  3668. diff -Nur musl-0.9.15/arch/x32/bits/posix.h musl-git/arch/x32/bits/posix.h
  3669. --- musl-0.9.15/arch/x32/bits/posix.h 1970-01-01 01:00:00.000000000 +0100
  3670. +++ musl-git/arch/x32/bits/posix.h 2014-03-19 07:42:48.000000000 +0100
  3671. @@ -0,0 +1,2 @@
  3672. +#define _POSIX_V6_LP64_OFF64 1
  3673. +#define _POSIX_V7_LP64_OFF64 1
  3674. diff -Nur musl-0.9.15/arch/x32/bits/reg.h musl-git/arch/x32/bits/reg.h
  3675. --- musl-0.9.15/arch/x32/bits/reg.h 1970-01-01 01:00:00.000000000 +0100
  3676. +++ musl-git/arch/x32/bits/reg.h 2014-03-19 07:42:48.000000000 +0100
  3677. @@ -0,0 +1,29 @@
  3678. +#undef __WORDSIZE
  3679. +#define __WORDSIZE 32
  3680. +#define R15 0
  3681. +#define R14 1
  3682. +#define R13 2
  3683. +#define R12 3
  3684. +#define RBP 4
  3685. +#define RBX 5
  3686. +#define R11 6
  3687. +#define R10 7
  3688. +#define R9 8
  3689. +#define R8 9
  3690. +#define RAX 10
  3691. +#define RCX 11
  3692. +#define RDX 12
  3693. +#define RSI 13
  3694. +#define RDI 14
  3695. +#define ORIG_RAX 15
  3696. +#define RIP 16
  3697. +#define CS 17
  3698. +#define EFLAGS 18
  3699. +#define RSP 19
  3700. +#define SS 20
  3701. +#define FS_BASE 21
  3702. +#define GS_BASE 22
  3703. +#define DS 23
  3704. +#define ES 24
  3705. +#define FS 25
  3706. +#define GS 26
  3707. diff -Nur musl-0.9.15/arch/x32/bits/sem.h musl-git/arch/x32/bits/sem.h
  3708. --- musl-0.9.15/arch/x32/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  3709. +++ musl-git/arch/x32/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  3710. @@ -0,0 +1,16 @@
  3711. +struct semid_ds {
  3712. + struct ipc_perm sem_perm;
  3713. + time_t sem_otime;
  3714. + time_t __unused1;
  3715. + time_t sem_ctime;
  3716. + time_t __unused2;
  3717. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  3718. + unsigned short sem_nsems;
  3719. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  3720. +#else
  3721. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  3722. + unsigned short sem_nsems;
  3723. +#endif
  3724. + time_t __unused3;
  3725. + time_t __unused4;
  3726. +};
  3727. diff -Nur musl-0.9.15/arch/x32/bits/setjmp.h musl-git/arch/x32/bits/setjmp.h
  3728. --- musl-0.9.15/arch/x32/bits/setjmp.h 1970-01-01 01:00:00.000000000 +0100
  3729. +++ musl-git/arch/x32/bits/setjmp.h 2014-03-19 07:42:48.000000000 +0100
  3730. @@ -0,0 +1 @@
  3731. +typedef unsigned long long __jmp_buf[8];
  3732. diff -Nur musl-0.9.15/arch/x32/bits/shm.h musl-git/arch/x32/bits/shm.h
  3733. --- musl-0.9.15/arch/x32/bits/shm.h 1970-01-01 01:00:00.000000000 +0100
  3734. +++ musl-git/arch/x32/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  3735. @@ -0,0 +1,33 @@
  3736. +#define SHMLBA 4096
  3737. +
  3738. +struct shmid_ds
  3739. +{
  3740. + struct ipc_perm shm_perm;
  3741. + size_t shm_segsz;
  3742. + time_t shm_atime;
  3743. + time_t shm_dtime;
  3744. + time_t shm_ctime;
  3745. + pid_t shm_cpid;
  3746. + pid_t shm_lpid;
  3747. + unsigned long shm_nattch;
  3748. + unsigned long __pad0;
  3749. + unsigned long long __pad1;
  3750. + unsigned long long __pad2;
  3751. +};
  3752. +
  3753. +struct shminfo {
  3754. + unsigned long shmmax, __pad0, shmmin, __pad1, shmmni, __pad2,
  3755. + shmseg, __pad3, shmall, __pad4;
  3756. + unsigned long long __unused[4];
  3757. +};
  3758. +
  3759. +struct shm_info {
  3760. + int __used_ids;
  3761. + int __pad_ids;
  3762. + unsigned long shm_tot, __pad0, shm_rss, __pad1, shm_swp, __pad2;
  3763. + unsigned long __swap_attempts, __pad3, __swap_successes, __pad4;
  3764. +}
  3765. +#ifdef __GNUC__
  3766. +__attribute__((__aligned__(8)))
  3767. +#endif
  3768. +;
  3769. diff -Nur musl-0.9.15/arch/x32/bits/signal.h musl-git/arch/x32/bits/signal.h
  3770. --- musl-0.9.15/arch/x32/bits/signal.h 1970-01-01 01:00:00.000000000 +0100
  3771. +++ musl-git/arch/x32/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  3772. @@ -0,0 +1,125 @@
  3773. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  3774. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3775. +
  3776. +#ifdef _GNU_SOURCE
  3777. +#define REG_R8 0
  3778. +#define REG_R9 1
  3779. +#define REG_R10 2
  3780. +#define REG_R11 3
  3781. +#define REG_R12 4
  3782. +#define REG_R13 5
  3783. +#define REG_R14 6
  3784. +#define REG_R15 7
  3785. +#define REG_RDI 8
  3786. +#define REG_RSI 9
  3787. +#define REG_RBP 10
  3788. +#define REG_RBX 11
  3789. +#define REG_RDX 12
  3790. +#define REG_RAX 13
  3791. +#define REG_RCX 14
  3792. +#define REG_RSP 15
  3793. +#define REG_RIP 16
  3794. +#define REG_EFL 17
  3795. +#define REG_CSGSFS 18
  3796. +#define REG_ERR 19
  3797. +#define REG_TRAPNO 20
  3798. +#define REG_OLDMASK 21
  3799. +#define REG_CR2 22
  3800. +#endif
  3801. +
  3802. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3803. +typedef long long greg_t, gregset_t[23];
  3804. +typedef struct _fpstate {
  3805. + unsigned short cwd, swd, ftw, fop;
  3806. + unsigned long long rip, rdp;
  3807. + unsigned mxcsr, mxcr_mask;
  3808. + struct {
  3809. + unsigned short significand[4], exponent, padding[3];
  3810. + } _st[8];
  3811. + struct {
  3812. + unsigned element[4];
  3813. + } _xmm[16];
  3814. + unsigned padding[24];
  3815. +} *fpregset_t;
  3816. +struct sigcontext {
  3817. + unsigned long long r8, r9, r10, r11, r12, r13, r14, r15;
  3818. + unsigned long long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
  3819. + unsigned short cs, gs, fs, __pad0;
  3820. + unsigned long long err, trapno, oldmask, cr2;
  3821. + struct _fpstate *fpstate;
  3822. + unsigned long long __reserved1[8];
  3823. +};
  3824. +typedef struct {
  3825. + gregset_t gregs;
  3826. + fpregset_t fpregs;
  3827. + unsigned long long __reserved1[8];
  3828. +} mcontext_t;
  3829. +#else
  3830. +typedef struct {
  3831. + unsigned long long __space[32];
  3832. +} mcontext_t;
  3833. +#endif
  3834. +
  3835. +struct sigaltstack {
  3836. + void *ss_sp;
  3837. + int ss_flags;
  3838. + size_t ss_size;
  3839. +};
  3840. +
  3841. +typedef struct __ucontext {
  3842. + unsigned long uc_flags;
  3843. + struct __ucontext *uc_link;
  3844. + stack_t uc_stack;
  3845. + mcontext_t uc_mcontext;
  3846. + sigset_t uc_sigmask;
  3847. + unsigned long long __fpregs_mem[64];
  3848. +} ucontext_t;
  3849. +
  3850. +#define SA_NOCLDSTOP 1
  3851. +#define SA_NOCLDWAIT 2
  3852. +#define SA_SIGINFO 4
  3853. +#define SA_ONSTACK 0x08000000
  3854. +#define SA_RESTART 0x10000000
  3855. +#define SA_NODEFER 0x40000000
  3856. +#define SA_RESETHAND 0x80000000
  3857. +#define SA_RESTORER 0x04000000
  3858. +
  3859. +#endif
  3860. +
  3861. +#define SIGHUP 1
  3862. +#define SIGINT 2
  3863. +#define SIGQUIT 3
  3864. +#define SIGILL 4
  3865. +#define SIGTRAP 5
  3866. +#define SIGABRT 6
  3867. +#define SIGIOT SIGABRT
  3868. +#define SIGBUS 7
  3869. +#define SIGFPE 8
  3870. +#define SIGKILL 9
  3871. +#define SIGUSR1 10
  3872. +#define SIGSEGV 11
  3873. +#define SIGUSR2 12
  3874. +#define SIGPIPE 13
  3875. +#define SIGALRM 14
  3876. +#define SIGTERM 15
  3877. +#define SIGSTKFLT 16
  3878. +#define SIGCHLD 17
  3879. +#define SIGCONT 18
  3880. +#define SIGSTOP 19
  3881. +#define SIGTSTP 20
  3882. +#define SIGTTIN 21
  3883. +#define SIGTTOU 22
  3884. +#define SIGURG 23
  3885. +#define SIGXCPU 24
  3886. +#define SIGXFSZ 25
  3887. +#define SIGVTALRM 26
  3888. +#define SIGPROF 27
  3889. +#define SIGWINCH 28
  3890. +#define SIGIO 29
  3891. +#define SIGPOLL 29
  3892. +#define SIGPWR 30
  3893. +#define SIGSYS 31
  3894. +#define SIGUNUSED SIGSYS
  3895. +
  3896. +#define _NSIG 65
  3897. +
  3898. diff -Nur musl-0.9.15/arch/x32/bits/socket.h musl-git/arch/x32/bits/socket.h
  3899. --- musl-0.9.15/arch/x32/bits/socket.h 1970-01-01 01:00:00.000000000 +0100
  3900. +++ musl-git/arch/x32/bits/socket.h 2014-03-19 07:42:48.000000000 +0100
  3901. @@ -0,0 +1,18 @@
  3902. +struct msghdr
  3903. +{
  3904. + void *msg_name;
  3905. + socklen_t msg_namelen;
  3906. + struct iovec *msg_iov;
  3907. + int msg_iovlen, __pad1;
  3908. + void *msg_control;
  3909. + socklen_t msg_controllen, __pad2;
  3910. + int msg_flags;
  3911. +};
  3912. +
  3913. +struct cmsghdr
  3914. +{
  3915. + socklen_t cmsg_len;
  3916. + int __pad1;
  3917. + int cmsg_level;
  3918. + int cmsg_type;
  3919. +};
  3920. diff -Nur musl-0.9.15/arch/x32/bits/statfs.h musl-git/arch/x32/bits/statfs.h
  3921. --- musl-0.9.15/arch/x32/bits/statfs.h 1970-01-01 01:00:00.000000000 +0100
  3922. +++ musl-git/arch/x32/bits/statfs.h 2014-03-19 07:42:48.000000000 +0100
  3923. @@ -0,0 +1,9 @@
  3924. +struct statfs {
  3925. + unsigned long f_type, __pad0, f_bsize, __pad1;
  3926. + fsblkcnt_t f_blocks, f_bfree, f_bavail;
  3927. + fsfilcnt_t f_files, f_ffree;
  3928. + fsid_t f_fsid;
  3929. + unsigned long f_namelen, __pad2, f_frsize, __pad3;
  3930. + unsigned long f_flags, __pad4;
  3931. + unsigned long long f_spare[4];
  3932. +};
  3933. diff -Nur musl-0.9.15/arch/x32/bits/stat.h musl-git/arch/x32/bits/stat.h
  3934. --- musl-0.9.15/arch/x32/bits/stat.h 1970-01-01 01:00:00.000000000 +0100
  3935. +++ musl-git/arch/x32/bits/stat.h 2014-03-19 07:42:48.000000000 +0100
  3936. @@ -0,0 +1,22 @@
  3937. +/* copied from kernel definition, but with padding replaced
  3938. + * by the corresponding correctly-sized userspace types. */
  3939. +
  3940. +struct stat {
  3941. + dev_t st_dev;
  3942. + ino_t st_ino;
  3943. + nlink_t st_nlink;
  3944. +
  3945. + mode_t st_mode;
  3946. + uid_t st_uid;
  3947. + gid_t st_gid;
  3948. + unsigned int __pad0;
  3949. + dev_t st_rdev;
  3950. + off_t st_size;
  3951. + blksize_t st_blksize;
  3952. + blkcnt_t st_blocks;
  3953. +
  3954. + struct timespec st_atim;
  3955. + struct timespec st_mtim;
  3956. + struct timespec st_ctim;
  3957. + long long __unused[3];
  3958. +};
  3959. diff -Nur musl-0.9.15/arch/x32/bits/stdarg.h musl-git/arch/x32/bits/stdarg.h
  3960. --- musl-0.9.15/arch/x32/bits/stdarg.h 1970-01-01 01:00:00.000000000 +0100
  3961. +++ musl-git/arch/x32/bits/stdarg.h 2014-03-19 07:42:48.000000000 +0100
  3962. @@ -0,0 +1,4 @@
  3963. +#define va_start(v,l) __builtin_va_start(v,l)
  3964. +#define va_end(v) __builtin_va_end(v)
  3965. +#define va_arg(v,l) __builtin_va_arg(v,l)
  3966. +#define va_copy(d,s) __builtin_va_copy(d,s)
  3967. diff -Nur musl-0.9.15/arch/x32/bits/stdint.h musl-git/arch/x32/bits/stdint.h
  3968. --- musl-0.9.15/arch/x32/bits/stdint.h 1970-01-01 01:00:00.000000000 +0100
  3969. +++ musl-git/arch/x32/bits/stdint.h 2014-03-19 07:42:48.000000000 +0100
  3970. @@ -0,0 +1,20 @@
  3971. +typedef int32_t int_fast16_t;
  3972. +typedef int32_t int_fast32_t;
  3973. +typedef uint32_t uint_fast16_t;
  3974. +typedef uint32_t uint_fast32_t;
  3975. +
  3976. +#define INT_FAST16_MIN INT32_MIN
  3977. +#define INT_FAST32_MIN INT32_MIN
  3978. +
  3979. +#define INT_FAST16_MAX INT32_MAX
  3980. +#define INT_FAST32_MAX INT32_MAX
  3981. +
  3982. +#define UINT_FAST16_MAX UINT32_MAX
  3983. +#define UINT_FAST32_MAX UINT32_MAX
  3984. +
  3985. +#define INTPTR_MIN INT32_MIN
  3986. +#define INTPTR_MAX INT32_MAX
  3987. +#define UINTPTR_MAX UINT32_MAX
  3988. +#define PTRDIFF_MIN INT32_MIN
  3989. +#define PTRDIFF_MAX INT32_MAX
  3990. +#define SIZE_MAX UINT32_MAX
  3991. diff -Nur musl-0.9.15/arch/x32/bits/syscall.h musl-git/arch/x32/bits/syscall.h
  3992. --- musl-0.9.15/arch/x32/bits/syscall.h 1970-01-01 01:00:00.000000000 +0100
  3993. +++ musl-git/arch/x32/bits/syscall.h 2014-03-19 07:42:48.000000000 +0100
  3994. @@ -0,0 +1,634 @@
  3995. +#define __X32_SYSCALL_BIT 0x40000000
  3996. +#define __NR_read (__X32_SYSCALL_BIT + 0)
  3997. +#define __NR_write (__X32_SYSCALL_BIT + 1)
  3998. +#define __NR_open (__X32_SYSCALL_BIT + 2)
  3999. +#define __NR_close (__X32_SYSCALL_BIT + 3)
  4000. +#define __NR_stat (__X32_SYSCALL_BIT + 4)
  4001. +#define __NR_fstat (__X32_SYSCALL_BIT + 5)
  4002. +#define __NR_lstat (__X32_SYSCALL_BIT + 6)
  4003. +#define __NR_poll (__X32_SYSCALL_BIT + 7)
  4004. +#define __NR_lseek (__X32_SYSCALL_BIT + 8)
  4005. +#define __NR_mmap (__X32_SYSCALL_BIT + 9)
  4006. +#define __NR_mprotect (__X32_SYSCALL_BIT + 10)
  4007. +#define __NR_munmap (__X32_SYSCALL_BIT + 11)
  4008. +#define __NR_brk (__X32_SYSCALL_BIT + 12)
  4009. +#define __NR_rt_sigprocmask (__X32_SYSCALL_BIT + 14)
  4010. +#define __NR_pread64 (__X32_SYSCALL_BIT + 17)
  4011. +#define __NR_pwrite64 (__X32_SYSCALL_BIT + 18)
  4012. +#define __NR_access (__X32_SYSCALL_BIT + 21)
  4013. +#define __NR_pipe (__X32_SYSCALL_BIT + 22)
  4014. +#define __NR_select (__X32_SYSCALL_BIT + 23)
  4015. +#define __NR_sched_yield (__X32_SYSCALL_BIT + 24)
  4016. +#define __NR_mremap (__X32_SYSCALL_BIT + 25)
  4017. +#define __NR_msync (__X32_SYSCALL_BIT + 26)
  4018. +#define __NR_mincore (__X32_SYSCALL_BIT + 27)
  4019. +#define __NR_madvise (__X32_SYSCALL_BIT + 28)
  4020. +#define __NR_shmget (__X32_SYSCALL_BIT + 29)
  4021. +#define __NR_shmat (__X32_SYSCALL_BIT + 30)
  4022. +#define __NR_shmctl (__X32_SYSCALL_BIT + 31)
  4023. +#define __NR_dup (__X32_SYSCALL_BIT + 32)
  4024. +#define __NR_dup2 (__X32_SYSCALL_BIT + 33)
  4025. +#define __NR_pause (__X32_SYSCALL_BIT + 34)
  4026. +#define __NR_nanosleep (__X32_SYSCALL_BIT + 35)
  4027. +#define __NR_getitimer (__X32_SYSCALL_BIT + 36)
  4028. +#define __NR_alarm (__X32_SYSCALL_BIT + 37)
  4029. +#define __NR_setitimer (__X32_SYSCALL_BIT + 38)
  4030. +#define __NR_getpid (__X32_SYSCALL_BIT + 39)
  4031. +#define __NR_sendfile (__X32_SYSCALL_BIT + 40)
  4032. +#define __NR_socket (__X32_SYSCALL_BIT + 41)
  4033. +#define __NR_connect (__X32_SYSCALL_BIT + 42)
  4034. +#define __NR_accept (__X32_SYSCALL_BIT + 43)
  4035. +#define __NR_sendto (__X32_SYSCALL_BIT + 44)
  4036. +#define __NR_shutdown (__X32_SYSCALL_BIT + 48)
  4037. +#define __NR_bind (__X32_SYSCALL_BIT + 49)
  4038. +#define __NR_listen (__X32_SYSCALL_BIT + 50)
  4039. +#define __NR_getsockname (__X32_SYSCALL_BIT + 51)
  4040. +#define __NR_getpeername (__X32_SYSCALL_BIT + 52)
  4041. +#define __NR_socketpair (__X32_SYSCALL_BIT + 53)
  4042. +#define __NR_clone (__X32_SYSCALL_BIT + 56)
  4043. +#define __NR_fork (__X32_SYSCALL_BIT + 57)
  4044. +#define __NR_vfork (__X32_SYSCALL_BIT + 58)
  4045. +#define __NR_exit (__X32_SYSCALL_BIT + 60)
  4046. +#define __NR_wait4 (__X32_SYSCALL_BIT + 61)
  4047. +#define __NR_kill (__X32_SYSCALL_BIT + 62)
  4048. +#define __NR_uname (__X32_SYSCALL_BIT + 63)
  4049. +#define __NR_semget (__X32_SYSCALL_BIT + 64)
  4050. +#define __NR_semop (__X32_SYSCALL_BIT + 65)
  4051. +#define __NR_semctl (__X32_SYSCALL_BIT + 66)
  4052. +#define __NR_shmdt (__X32_SYSCALL_BIT + 67)
  4053. +#define __NR_msgget (__X32_SYSCALL_BIT + 68)
  4054. +#define __NR_msgsnd (__X32_SYSCALL_BIT + 69)
  4055. +#define __NR_msgrcv (__X32_SYSCALL_BIT + 70)
  4056. +#define __NR_msgctl (__X32_SYSCALL_BIT + 71)
  4057. +#define __NR_fcntl (__X32_SYSCALL_BIT + 72)
  4058. +#define __NR_flock (__X32_SYSCALL_BIT + 73)
  4059. +#define __NR_fsync (__X32_SYSCALL_BIT + 74)
  4060. +#define __NR_fdatasync (__X32_SYSCALL_BIT + 75)
  4061. +#define __NR_truncate (__X32_SYSCALL_BIT + 76)
  4062. +#define __NR_ftruncate (__X32_SYSCALL_BIT + 77)
  4063. +#define __NR_getdents (__X32_SYSCALL_BIT + 78)
  4064. +#define __NR_getcwd (__X32_SYSCALL_BIT + 79)
  4065. +#define __NR_chdir (__X32_SYSCALL_BIT + 80)
  4066. +#define __NR_fchdir (__X32_SYSCALL_BIT + 81)
  4067. +#define __NR_rename (__X32_SYSCALL_BIT + 82)
  4068. +#define __NR_mkdir (__X32_SYSCALL_BIT + 83)
  4069. +#define __NR_rmdir (__X32_SYSCALL_BIT + 84)
  4070. +#define __NR_creat (__X32_SYSCALL_BIT + 85)
  4071. +#define __NR_link (__X32_SYSCALL_BIT + 86)
  4072. +#define __NR_unlink (__X32_SYSCALL_BIT + 87)
  4073. +#define __NR_symlink (__X32_SYSCALL_BIT + 88)
  4074. +#define __NR_readlink (__X32_SYSCALL_BIT + 89)
  4075. +#define __NR_chmod (__X32_SYSCALL_BIT + 90)
  4076. +#define __NR_fchmod (__X32_SYSCALL_BIT + 91)
  4077. +#define __NR_chown (__X32_SYSCALL_BIT + 92)
  4078. +#define __NR_fchown (__X32_SYSCALL_BIT + 93)
  4079. +#define __NR_lchown (__X32_SYSCALL_BIT + 94)
  4080. +#define __NR_umask (__X32_SYSCALL_BIT + 95)
  4081. +#define __NR_gettimeofday (__X32_SYSCALL_BIT + 96)
  4082. +#define __NR_getrlimit (__X32_SYSCALL_BIT + 97)
  4083. +#define __NR_getrusage (__X32_SYSCALL_BIT + 98)
  4084. +#define __NR_sysinfo (__X32_SYSCALL_BIT + 99)
  4085. +#define __NR_times (__X32_SYSCALL_BIT + 100)
  4086. +#define __NR_getuid (__X32_SYSCALL_BIT + 102)
  4087. +#define __NR_syslog (__X32_SYSCALL_BIT + 103)
  4088. +#define __NR_getgid (__X32_SYSCALL_BIT + 104)
  4089. +#define __NR_setuid (__X32_SYSCALL_BIT + 105)
  4090. +#define __NR_setgid (__X32_SYSCALL_BIT + 106)
  4091. +#define __NR_geteuid (__X32_SYSCALL_BIT + 107)
  4092. +#define __NR_getegid (__X32_SYSCALL_BIT + 108)
  4093. +#define __NR_setpgid (__X32_SYSCALL_BIT + 109)
  4094. +#define __NR_getppid (__X32_SYSCALL_BIT + 110)
  4095. +#define __NR_getpgrp (__X32_SYSCALL_BIT + 111)
  4096. +#define __NR_setsid (__X32_SYSCALL_BIT + 112)
  4097. +#define __NR_setreuid (__X32_SYSCALL_BIT + 113)
  4098. +#define __NR_setregid (__X32_SYSCALL_BIT + 114)
  4099. +#define __NR_getgroups (__X32_SYSCALL_BIT + 115)
  4100. +#define __NR_setgroups (__X32_SYSCALL_BIT + 116)
  4101. +#define __NR_setresuid (__X32_SYSCALL_BIT + 117)
  4102. +#define __NR_getresuid (__X32_SYSCALL_BIT + 118)
  4103. +#define __NR_setresgid (__X32_SYSCALL_BIT + 119)
  4104. +#define __NR_getresgid (__X32_SYSCALL_BIT + 120)
  4105. +#define __NR_getpgid (__X32_SYSCALL_BIT + 121)
  4106. +#define __NR_setfsuid (__X32_SYSCALL_BIT + 122)
  4107. +#define __NR_setfsgid (__X32_SYSCALL_BIT + 123)
  4108. +#define __NR_getsid (__X32_SYSCALL_BIT + 124)
  4109. +#define __NR_capget (__X32_SYSCALL_BIT + 125)
  4110. +#define __NR_capset (__X32_SYSCALL_BIT + 126)
  4111. +#define __NR_rt_sigsuspend (__X32_SYSCALL_BIT + 130)
  4112. +#define __NR_utime (__X32_SYSCALL_BIT + 132)
  4113. +#define __NR_mknod (__X32_SYSCALL_BIT + 133)
  4114. +#define __NR_personality (__X32_SYSCALL_BIT + 135)
  4115. +#define __NR_ustat (__X32_SYSCALL_BIT + 136)
  4116. +#define __NR_statfs (__X32_SYSCALL_BIT + 137)
  4117. +#define __NR_fstatfs (__X32_SYSCALL_BIT + 138)
  4118. +#define __NR_sysfs (__X32_SYSCALL_BIT + 139)
  4119. +#define __NR_getpriority (__X32_SYSCALL_BIT + 140)
  4120. +#define __NR_setpriority (__X32_SYSCALL_BIT + 141)
  4121. +#define __NR_sched_setparam (__X32_SYSCALL_BIT + 142)
  4122. +#define __NR_sched_getparam (__X32_SYSCALL_BIT + 143)
  4123. +#define __NR_sched_setscheduler (__X32_SYSCALL_BIT + 144)
  4124. +#define __NR_sched_getscheduler (__X32_SYSCALL_BIT + 145)
  4125. +#define __NR_sched_get_priority_max (__X32_SYSCALL_BIT + 146)
  4126. +#define __NR_sched_get_priority_min (__X32_SYSCALL_BIT + 147)
  4127. +#define __NR_sched_rr_get_interval (__X32_SYSCALL_BIT + 148)
  4128. +#define __NR_mlock (__X32_SYSCALL_BIT + 149)
  4129. +#define __NR_munlock (__X32_SYSCALL_BIT + 150)
  4130. +#define __NR_mlockall (__X32_SYSCALL_BIT + 151)
  4131. +#define __NR_munlockall (__X32_SYSCALL_BIT + 152)
  4132. +#define __NR_vhangup (__X32_SYSCALL_BIT + 153)
  4133. +#define __NR_modify_ldt (__X32_SYSCALL_BIT + 154)
  4134. +#define __NR_pivot_root (__X32_SYSCALL_BIT + 155)
  4135. +#define __NR_prctl (__X32_SYSCALL_BIT + 157)
  4136. +#define __NR_arch_prctl (__X32_SYSCALL_BIT + 158)
  4137. +#define __NR_adjtimex (__X32_SYSCALL_BIT + 159)
  4138. +#define __NR_setrlimit (__X32_SYSCALL_BIT + 160)
  4139. +#define __NR_chroot (__X32_SYSCALL_BIT + 161)
  4140. +#define __NR_sync (__X32_SYSCALL_BIT + 162)
  4141. +#define __NR_acct (__X32_SYSCALL_BIT + 163)
  4142. +#define __NR_settimeofday (__X32_SYSCALL_BIT + 164)
  4143. +#define __NR_mount (__X32_SYSCALL_BIT + 165)
  4144. +#define __NR_umount2 (__X32_SYSCALL_BIT + 166)
  4145. +#define __NR_swapon (__X32_SYSCALL_BIT + 167)
  4146. +#define __NR_swapoff (__X32_SYSCALL_BIT + 168)
  4147. +#define __NR_reboot (__X32_SYSCALL_BIT + 169)
  4148. +#define __NR_sethostname (__X32_SYSCALL_BIT + 170)
  4149. +#define __NR_setdomainname (__X32_SYSCALL_BIT + 171)
  4150. +#define __NR_iopl (__X32_SYSCALL_BIT + 172)
  4151. +#define __NR_ioperm (__X32_SYSCALL_BIT + 173)
  4152. +#define __NR_init_module (__X32_SYSCALL_BIT + 175)
  4153. +#define __NR_delete_module (__X32_SYSCALL_BIT + 176)
  4154. +#define __NR_quotactl (__X32_SYSCALL_BIT + 179)
  4155. +#define __NR_getpmsg (__X32_SYSCALL_BIT + 181)
  4156. +#define __NR_putpmsg (__X32_SYSCALL_BIT + 182)
  4157. +#define __NR_afs_syscall (__X32_SYSCALL_BIT + 183)
  4158. +#define __NR_tuxcall (__X32_SYSCALL_BIT + 184)
  4159. +#define __NR_security (__X32_SYSCALL_BIT + 185)
  4160. +#define __NR_gettid (__X32_SYSCALL_BIT + 186)
  4161. +#define __NR_readahead (__X32_SYSCALL_BIT + 187)
  4162. +#define __NR_setxattr (__X32_SYSCALL_BIT + 188)
  4163. +#define __NR_lsetxattr (__X32_SYSCALL_BIT + 189)
  4164. +#define __NR_fsetxattr (__X32_SYSCALL_BIT + 190)
  4165. +#define __NR_getxattr (__X32_SYSCALL_BIT + 191)
  4166. +#define __NR_lgetxattr (__X32_SYSCALL_BIT + 192)
  4167. +#define __NR_fgetxattr (__X32_SYSCALL_BIT + 193)
  4168. +#define __NR_listxattr (__X32_SYSCALL_BIT + 194)
  4169. +#define __NR_llistxattr (__X32_SYSCALL_BIT + 195)
  4170. +#define __NR_flistxattr (__X32_SYSCALL_BIT + 196)
  4171. +#define __NR_removexattr (__X32_SYSCALL_BIT + 197)
  4172. +#define __NR_lremovexattr (__X32_SYSCALL_BIT + 198)
  4173. +#define __NR_fremovexattr (__X32_SYSCALL_BIT + 199)
  4174. +#define __NR_tkill (__X32_SYSCALL_BIT + 200)
  4175. +#define __NR_time (__X32_SYSCALL_BIT + 201)
  4176. +#define __NR_futex (__X32_SYSCALL_BIT + 202)
  4177. +#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203)
  4178. +#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
  4179. +#define __NR_io_setup (__X32_SYSCALL_BIT + 206)
  4180. +#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
  4181. +#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
  4182. +#define __NR_io_submit (__X32_SYSCALL_BIT + 209)
  4183. +#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
  4184. +#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212)
  4185. +#define __NR_epoll_create (__X32_SYSCALL_BIT + 213)
  4186. +#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216)
  4187. +#define __NR_getdents64 (__X32_SYSCALL_BIT + 217)
  4188. +#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218)
  4189. +#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219)
  4190. +#define __NR_semtimedop (__X32_SYSCALL_BIT + 220)
  4191. +#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221)
  4192. +#define __NR_timer_settime (__X32_SYSCALL_BIT + 223)
  4193. +#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224)
  4194. +#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225)
  4195. +#define __NR_timer_delete (__X32_SYSCALL_BIT + 226)
  4196. +#define __NR_clock_settime (__X32_SYSCALL_BIT + 227)
  4197. +#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228)
  4198. +#define __NR_clock_getres (__X32_SYSCALL_BIT + 229)
  4199. +#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230)
  4200. +#define __NR_exit_group (__X32_SYSCALL_BIT + 231)
  4201. +#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232)
  4202. +#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233)
  4203. +#define __NR_tgkill (__X32_SYSCALL_BIT + 234)
  4204. +#define __NR_utimes (__X32_SYSCALL_BIT + 235)
  4205. +#define __NR_mbind (__X32_SYSCALL_BIT + 237)
  4206. +#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238)
  4207. +#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239)
  4208. +#define __NR_mq_open (__X32_SYSCALL_BIT + 240)
  4209. +#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241)
  4210. +#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242)
  4211. +#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243)
  4212. +#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245)
  4213. +#define __NR_add_key (__X32_SYSCALL_BIT + 248)
  4214. +#define __NR_request_key (__X32_SYSCALL_BIT + 249)
  4215. +#define __NR_keyctl (__X32_SYSCALL_BIT + 250)
  4216. +#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251)
  4217. +#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252)
  4218. +#define __NR_inotify_init (__X32_SYSCALL_BIT + 253)
  4219. +#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254)
  4220. +#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255)
  4221. +#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256)
  4222. +#define __NR_openat (__X32_SYSCALL_BIT + 257)
  4223. +#define __NR_mkdirat (__X32_SYSCALL_BIT + 258)
  4224. +#define __NR_mknodat (__X32_SYSCALL_BIT + 259)
  4225. +#define __NR_fchownat (__X32_SYSCALL_BIT + 260)
  4226. +#define __NR_futimesat (__X32_SYSCALL_BIT + 261)
  4227. +#define __NR_newfstatat (__X32_SYSCALL_BIT + 262)
  4228. +#define __NR_unlinkat (__X32_SYSCALL_BIT + 263)
  4229. +#define __NR_renameat (__X32_SYSCALL_BIT + 264)
  4230. +#define __NR_linkat (__X32_SYSCALL_BIT + 265)
  4231. +#define __NR_symlinkat (__X32_SYSCALL_BIT + 266)
  4232. +#define __NR_readlinkat (__X32_SYSCALL_BIT + 267)
  4233. +#define __NR_fchmodat (__X32_SYSCALL_BIT + 268)
  4234. +#define __NR_faccessat (__X32_SYSCALL_BIT + 269)
  4235. +#define __NR_pselect6 (__X32_SYSCALL_BIT + 270)
  4236. +#define __NR_ppoll (__X32_SYSCALL_BIT + 271)
  4237. +#define __NR_unshare (__X32_SYSCALL_BIT + 272)
  4238. +#define __NR_splice (__X32_SYSCALL_BIT + 275)
  4239. +#define __NR_tee (__X32_SYSCALL_BIT + 276)
  4240. +#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277)
  4241. +#define __NR_utimensat (__X32_SYSCALL_BIT + 280)
  4242. +#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281)
  4243. +#define __NR_signalfd (__X32_SYSCALL_BIT + 282)
  4244. +#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283)
  4245. +#define __NR_eventfd (__X32_SYSCALL_BIT + 284)
  4246. +#define __NR_fallocate (__X32_SYSCALL_BIT + 285)
  4247. +#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286)
  4248. +#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287)
  4249. +#define __NR_accept4 (__X32_SYSCALL_BIT + 288)
  4250. +#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289)
  4251. +#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290)
  4252. +#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291)
  4253. +#define __NR_dup3 (__X32_SYSCALL_BIT + 292)
  4254. +#define __NR_pipe2 (__X32_SYSCALL_BIT + 293)
  4255. +#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294)
  4256. +#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298)
  4257. +#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300)
  4258. +#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301)
  4259. +#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302)
  4260. +#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303)
  4261. +#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304)
  4262. +#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305)
  4263. +#define __NR_syncfs (__X32_SYSCALL_BIT + 306)
  4264. +#define __NR_setns (__X32_SYSCALL_BIT + 308)
  4265. +#define __NR_getcpu (__X32_SYSCALL_BIT + 309)
  4266. +#define __NR_kcmp (__X32_SYSCALL_BIT + 312)
  4267. +#define __NR_finit_module (__X32_SYSCALL_BIT + 313)
  4268. +#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
  4269. +#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
  4270. +#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
  4271. +#define __NR_readv (__X32_SYSCALL_BIT + 515)
  4272. +#define __NR_writev (__X32_SYSCALL_BIT + 516)
  4273. +#define __NR_recvfrom (__X32_SYSCALL_BIT + 517)
  4274. +#define __NR_sendmsg (__X32_SYSCALL_BIT + 518)
  4275. +#define __NR_recvmsg (__X32_SYSCALL_BIT + 519)
  4276. +#define __NR_execve (__X32_SYSCALL_BIT + 520)
  4277. +#define __NR_ptrace (__X32_SYSCALL_BIT + 521)
  4278. +#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522)
  4279. +#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523)
  4280. +#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524)
  4281. +#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525)
  4282. +#define __NR_timer_create (__X32_SYSCALL_BIT + 526)
  4283. +#define __NR_mq_notify (__X32_SYSCALL_BIT + 527)
  4284. +#define __NR_kexec_load (__X32_SYSCALL_BIT + 528)
  4285. +#define __NR_waitid (__X32_SYSCALL_BIT + 529)
  4286. +#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530)
  4287. +#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531)
  4288. +#define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
  4289. +#define __NR_move_pages (__X32_SYSCALL_BIT + 533)
  4290. +#define __NR_preadv (__X32_SYSCALL_BIT + 534)
  4291. +#define __NR_pwritev (__X32_SYSCALL_BIT + 535)
  4292. +#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
  4293. +#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
  4294. +#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
  4295. +#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539)
  4296. +#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540)
  4297. +#define __NR_setsockopt (__X32_SYSCALL_BIT + 541)
  4298. +#define __NR_getsockopt (__X32_SYSCALL_BIT + 542)
  4299. +
  4300. +#undef __NR_fstatat
  4301. +#undef __NR_pread
  4302. +#undef __NR_pwrite
  4303. +#undef __NR_getdents
  4304. +#define __NR_fstatat __NR_newfstatat
  4305. +#define __NR_pread __NR_pread64
  4306. +#define __NR_pwrite __NR_pwrite64
  4307. +#define __NR_getdents __NR_getdents64
  4308. +#define __NR_fadvise __NR_fadvise64
  4309. +
  4310. +
  4311. +
  4312. +/* Repeat with SYS_ prefix */
  4313. +
  4314. +
  4315. +
  4316. +#define SYS_read __NR_read
  4317. +#define SYS_write __NR_write
  4318. +#define SYS_open __NR_open
  4319. +#define SYS_close __NR_close
  4320. +#define SYS_stat __NR_stat
  4321. +#define SYS_fstat __NR_fstat
  4322. +#define SYS_lstat __NR_lstat
  4323. +#define SYS_poll __NR_poll
  4324. +#define SYS_lseek __NR_lseek
  4325. +#define SYS_mmap __NR_mmap
  4326. +#define SYS_mprotect __NR_mprotect
  4327. +#define SYS_munmap __NR_munmap
  4328. +#define SYS_brk __NR_brk
  4329. +#define SYS_rt_sigprocmask __NR_rt_sigprocmask
  4330. +#define SYS_pread64 __NR_pread64
  4331. +#define SYS_pwrite64 __NR_pwrite64
  4332. +#define SYS_access __NR_access
  4333. +#define SYS_pipe __NR_pipe
  4334. +#define SYS_select __NR_select
  4335. +#define SYS_sched_yield __NR_sched_yield
  4336. +#define SYS_mremap __NR_mremap
  4337. +#define SYS_msync __NR_msync
  4338. +#define SYS_mincore __NR_mincore
  4339. +#define SYS_madvise __NR_madvise
  4340. +#define SYS_shmget __NR_shmget
  4341. +#define SYS_shmat __NR_shmat
  4342. +#define SYS_shmctl __NR_shmctl
  4343. +#define SYS_dup __NR_dup
  4344. +#define SYS_dup2 __NR_dup2
  4345. +#define SYS_pause __NR_pause
  4346. +#define SYS_nanosleep __NR_nanosleep
  4347. +#define SYS_getitimer __NR_getitimer
  4348. +#define SYS_alarm __NR_alarm
  4349. +#define SYS_setitimer __NR_setitimer
  4350. +#define SYS_getpid __NR_getpid
  4351. +#define SYS_sendfile __NR_sendfile
  4352. +#define SYS_socket __NR_socket
  4353. +#define SYS_connect __NR_connect
  4354. +#define SYS_accept __NR_accept
  4355. +#define SYS_sendto __NR_sendto
  4356. +#define SYS_shutdown __NR_shutdown
  4357. +#define SYS_bind __NR_bind
  4358. +#define SYS_listen __NR_listen
  4359. +#define SYS_getsockname __NR_getsockname
  4360. +#define SYS_getpeername __NR_getpeername
  4361. +#define SYS_socketpair __NR_socketpair
  4362. +#define SYS_clone __NR_clone
  4363. +#define SYS_fork __NR_fork
  4364. +#define SYS_vfork __NR_vfork
  4365. +#define SYS_exit __NR_exit
  4366. +#define SYS_wait4 __NR_wait4
  4367. +#define SYS_kill __NR_kill
  4368. +#define SYS_uname __NR_uname
  4369. +#define SYS_semget __NR_semget
  4370. +#define SYS_semop __NR_semop
  4371. +#define SYS_semctl __NR_semctl
  4372. +#define SYS_shmdt __NR_shmdt
  4373. +#define SYS_msgget __NR_msgget
  4374. +#define SYS_msgsnd __NR_msgsnd
  4375. +#define SYS_msgrcv __NR_msgrcv
  4376. +#define SYS_msgctl __NR_msgctl
  4377. +#define SYS_fcntl __NR_fcntl
  4378. +#define SYS_flock __NR_flock
  4379. +#define SYS_fsync __NR_fsync
  4380. +#define SYS_fdatasync __NR_fdatasync
  4381. +#define SYS_truncate __NR_truncate
  4382. +#define SYS_ftruncate __NR_ftruncate
  4383. +#define SYS_getdents __NR_getdents
  4384. +#define SYS_getcwd __NR_getcwd
  4385. +#define SYS_chdir __NR_chdir
  4386. +#define SYS_fchdir __NR_fchdir
  4387. +#define SYS_rename __NR_rename
  4388. +#define SYS_mkdir __NR_mkdir
  4389. +#define SYS_rmdir __NR_rmdir
  4390. +#define SYS_creat __NR_creat
  4391. +#define SYS_link __NR_link
  4392. +#define SYS_unlink __NR_unlink
  4393. +#define SYS_symlink __NR_symlink
  4394. +#define SYS_readlink __NR_readlink
  4395. +#define SYS_chmod __NR_chmod
  4396. +#define SYS_fchmod __NR_fchmod
  4397. +#define SYS_chown __NR_chown
  4398. +#define SYS_fchown __NR_fchown
  4399. +#define SYS_lchown __NR_lchown
  4400. +#define SYS_umask __NR_umask
  4401. +#define SYS_gettimeofday __NR_gettimeofday
  4402. +#define SYS_getrlimit __NR_getrlimit
  4403. +#define SYS_getrusage __NR_getrusage
  4404. +#define SYS_sysinfo __NR_sysinfo
  4405. +#define SYS_times __NR_times
  4406. +#define SYS_getuid __NR_getuid
  4407. +#define SYS_syslog __NR_syslog
  4408. +#define SYS_getgid __NR_getgid
  4409. +#define SYS_setuid __NR_setuid
  4410. +#define SYS_setgid __NR_setgid
  4411. +#define SYS_geteuid __NR_geteuid
  4412. +#define SYS_getegid __NR_getegid
  4413. +#define SYS_setpgid __NR_setpgid
  4414. +#define SYS_getppid __NR_getppid
  4415. +#define SYS_getpgrp __NR_getpgrp
  4416. +#define SYS_setsid __NR_setsid
  4417. +#define SYS_setreuid __NR_setreuid
  4418. +#define SYS_setregid __NR_setregid
  4419. +#define SYS_getgroups __NR_getgroups
  4420. +#define SYS_setgroups __NR_setgroups
  4421. +#define SYS_setresuid __NR_setresuid
  4422. +#define SYS_getresuid __NR_getresuid
  4423. +#define SYS_setresgid __NR_setresgid
  4424. +#define SYS_getresgid __NR_getresgid
  4425. +#define SYS_getpgid __NR_getpgid
  4426. +#define SYS_setfsuid __NR_setfsuid
  4427. +#define SYS_setfsgid __NR_setfsgid
  4428. +#define SYS_getsid __NR_getsid
  4429. +#define SYS_capget __NR_capget
  4430. +#define SYS_capset __NR_capset
  4431. +#define SYS_rt_sigsuspend __NR_rt_sigsuspend
  4432. +#define SYS_utime __NR_utime
  4433. +#define SYS_mknod __NR_mknod
  4434. +#define SYS_personality __NR_personality
  4435. +#define SYS_ustat __NR_ustat
  4436. +#define SYS_statfs __NR_statfs
  4437. +#define SYS_fstatfs __NR_fstatfs
  4438. +#define SYS_sysfs __NR_sysfs
  4439. +#define SYS_getpriority __NR_getpriority
  4440. +#define SYS_setpriority __NR_setpriority
  4441. +#define SYS_sched_setparam __NR_sched_setparam
  4442. +#define SYS_sched_getparam __NR_sched_getparam
  4443. +#define SYS_sched_setscheduler __NR_sched_setscheduler
  4444. +#define SYS_sched_getscheduler __NR_sched_getscheduler
  4445. +#define SYS_sched_get_priority_max __NR_sched_get_priority_max
  4446. +#define SYS_sched_get_priority_min __NR_sched_get_priority_min
  4447. +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
  4448. +#define SYS_mlock __NR_mlock
  4449. +#define SYS_munlock __NR_munlock
  4450. +#define SYS_mlockall __NR_mlockall
  4451. +#define SYS_munlockall __NR_munlockall
  4452. +#define SYS_vhangup __NR_vhangup
  4453. +#define SYS_modify_ldt __NR_modify_ldt
  4454. +#define SYS_pivot_root __NR_pivot_root
  4455. +#define SYS_prctl __NR_prctl
  4456. +#define SYS_arch_prctl __NR_arch_prctl
  4457. +#define SYS_adjtimex __NR_adjtimex
  4458. +#define SYS_setrlimit __NR_setrlimit
  4459. +#define SYS_chroot __NR_chroot
  4460. +#define SYS_sync __NR_sync
  4461. +#define SYS_acct __NR_acct
  4462. +#define SYS_settimeofday __NR_settimeofday
  4463. +#define SYS_mount __NR_mount
  4464. +#define SYS_umount2 __NR_umount2
  4465. +#define SYS_swapon __NR_swapon
  4466. +#define SYS_swapoff __NR_swapoff
  4467. +#define SYS_reboot __NR_reboot
  4468. +#define SYS_sethostname __NR_sethostname
  4469. +#define SYS_setdomainname __NR_setdomainname
  4470. +#define SYS_iopl __NR_iopl
  4471. +#define SYS_ioperm __NR_ioperm
  4472. +#define SYS_init_module __NR_init_module
  4473. +#define SYS_delete_module __NR_delete_module
  4474. +#define SYS_quotactl __NR_quotactl
  4475. +#define SYS_getpmsg __NR_getpmsg
  4476. +#define SYS_putpmsg __NR_putpmsg
  4477. +#define SYS_afs_syscall __NR_afs_syscall
  4478. +#define SYS_tuxcall __NR_tuxcall
  4479. +#define SYS_security __NR_security
  4480. +#define SYS_gettid __NR_gettid
  4481. +#define SYS_readahead __NR_readahead
  4482. +#define SYS_setxattr __NR_setxattr
  4483. +#define SYS_lsetxattr __NR_lsetxattr
  4484. +#define SYS_fsetxattr __NR_fsetxattr
  4485. +#define SYS_getxattr __NR_getxattr
  4486. +#define SYS_lgetxattr __NR_lgetxattr
  4487. +#define SYS_fgetxattr __NR_fgetxattr
  4488. +#define SYS_listxattr __NR_listxattr
  4489. +#define SYS_llistxattr __NR_llistxattr
  4490. +#define SYS_flistxattr __NR_flistxattr
  4491. +#define SYS_removexattr __NR_removexattr
  4492. +#define SYS_lremovexattr __NR_lremovexattr
  4493. +#define SYS_fremovexattr __NR_fremovexattr
  4494. +#define SYS_tkill __NR_tkill
  4495. +#define SYS_time __NR_time
  4496. +#define SYS_futex __NR_futex
  4497. +#define SYS_sched_setaffinity __NR_sched_setaffinity
  4498. +#define SYS_sched_getaffinity __NR_sched_getaffinity
  4499. +#define SYS_io_setup __NR_io_setup
  4500. +#define SYS_io_destroy __NR_io_destroy
  4501. +#define SYS_io_getevents __NR_io_getevents
  4502. +#define SYS_io_submit __NR_io_submit
  4503. +#define SYS_io_cancel __NR_io_cancel
  4504. +#define SYS_lookup_dcookie __NR_lookup_dcookie
  4505. +#define SYS_epoll_create __NR_epoll_create
  4506. +#define SYS_remap_file_pages __NR_remap_file_pages
  4507. +#define SYS_getdents64 __NR_getdents64
  4508. +#define SYS_set_tid_address __NR_set_tid_address
  4509. +#define SYS_restart_syscall __NR_restart_syscall
  4510. +#define SYS_semtimedop __NR_semtimedop
  4511. +#define SYS_fadvise64 __NR_fadvise64
  4512. +#define SYS_timer_settime __NR_timer_settime
  4513. +#define SYS_timer_gettime __NR_timer_gettime
  4514. +#define SYS_timer_getoverrun __NR_timer_getoverrun
  4515. +#define SYS_timer_delete __NR_timer_delete
  4516. +#define SYS_clock_settime __NR_clock_settime
  4517. +#define SYS_clock_gettime __NR_clock_gettime
  4518. +#define SYS_clock_getres __NR_clock_getres
  4519. +#define SYS_clock_nanosleep __NR_clock_nanosleep
  4520. +#define SYS_exit_group __NR_exit_group
  4521. +#define SYS_epoll_wait __NR_epoll_wait
  4522. +#define SYS_epoll_ctl __NR_epoll_ctl
  4523. +#define SYS_tgkill __NR_tgkill
  4524. +#define SYS_utimes __NR_utimes
  4525. +#define SYS_mbind __NR_mbind
  4526. +#define SYS_set_mempolicy __NR_set_mempolicy
  4527. +#define SYS_get_mempolicy __NR_get_mempolicy
  4528. +#define SYS_mq_open __NR_mq_open
  4529. +#define SYS_mq_unlink __NR_mq_unlink
  4530. +#define SYS_mq_timedsend __NR_mq_timedsend
  4531. +#define SYS_mq_timedreceive __NR_mq_timedreceive
  4532. +#define SYS_mq_getsetattr __NR_mq_getsetattr
  4533. +#define SYS_add_key __NR_add_key
  4534. +#define SYS_request_key __NR_request_key
  4535. +#define SYS_keyctl __NR_keyctl
  4536. +#define SYS_ioprio_set __NR_ioprio_set
  4537. +#define SYS_ioprio_get __NR_ioprio_get
  4538. +#define SYS_inotify_init __NR_inotify_init
  4539. +#define SYS_inotify_add_watch __NR_inotify_add_watch
  4540. +#define SYS_inotify_rm_watch __NR_inotify_rm_watch
  4541. +#define SYS_migrate_pages __NR_migrate_pages
  4542. +#define SYS_openat __NR_openat
  4543. +#define SYS_mkdirat __NR_mkdirat
  4544. +#define SYS_mknodat __NR_mknodat
  4545. +#define SYS_fchownat __NR_fchownat
  4546. +#define SYS_futimesat __NR_futimesat
  4547. +#define SYS_newfstatat __NR_newfstatat
  4548. +#define SYS_unlinkat __NR_unlinkat
  4549. +#define SYS_renameat __NR_renameat
  4550. +#define SYS_linkat __NR_linkat
  4551. +#define SYS_symlinkat __NR_symlinkat
  4552. +#define SYS_readlinkat __NR_readlinkat
  4553. +#define SYS_fchmodat __NR_fchmodat
  4554. +#define SYS_faccessat __NR_faccessat
  4555. +#define SYS_pselect6 __NR_pselect6
  4556. +#define SYS_ppoll __NR_ppoll
  4557. +#define SYS_unshare __NR_unshare
  4558. +#define SYS_splice __NR_splice
  4559. +#define SYS_tee __NR_tee
  4560. +#define SYS_sync_file_range __NR_sync_file_range
  4561. +#define SYS_utimensat __NR_utimensat
  4562. +#define SYS_epoll_pwait __NR_epoll_pwait
  4563. +#define SYS_signalfd __NR_signalfd
  4564. +#define SYS_timerfd_create __NR_timerfd_create
  4565. +#define SYS_eventfd __NR_eventfd
  4566. +#define SYS_fallocate __NR_fallocate
  4567. +#define SYS_timerfd_settime __NR_timerfd_settime
  4568. +#define SYS_timerfd_gettime __NR_timerfd_gettime
  4569. +#define SYS_accept4 __NR_accept4
  4570. +#define SYS_signalfd4 __NR_signalfd4
  4571. +#define SYS_eventfd2 __NR_eventfd2
  4572. +#define SYS_epoll_create1 __NR_epoll_create1
  4573. +#define SYS_dup3 __NR_dup3
  4574. +#define SYS_pipe2 __NR_pipe2
  4575. +#define SYS_inotify_init1 __NR_inotify_init1
  4576. +#define SYS_perf_event_open __NR_perf_event_open
  4577. +#define SYS_fanotify_init __NR_fanotify_init
  4578. +#define SYS_fanotify_mark __NR_fanotify_mark
  4579. +#define SYS_prlimit64 __NR_prlimit64
  4580. +#define SYS_name_to_handle_at __NR_name_to_handle_at
  4581. +#define SYS_open_by_handle_at __NR_open_by_handle_at
  4582. +#define SYS_clock_adjtime __NR_clock_adjtime
  4583. +#define SYS_syncfs __NR_syncfs
  4584. +#define SYS_setns __NR_setns
  4585. +#define SYS_getcpu __NR_getcpu
  4586. +#define SYS_kcmp __NR_kcmp
  4587. +#define SYS_finit_module __NR_finit_module
  4588. +#define SYS_rt_sigaction __NR_rt_sigaction
  4589. +#define SYS_rt_sigreturn __NR_rt_sigreturn
  4590. +#define SYS_ioctl __NR_ioctl
  4591. +#define SYS_readv __NR_readv
  4592. +#define SYS_writev __NR_writev
  4593. +#define SYS_recvfrom __NR_recvfrom
  4594. +#define SYS_sendmsg __NR_sendmsg
  4595. +#define SYS_recvmsg __NR_recvmsg
  4596. +#define SYS_execve __NR_execve
  4597. +#define SYS_ptrace __NR_ptrace
  4598. +#define SYS_rt_sigpending __NR_rt_sigpending
  4599. +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
  4600. +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
  4601. +#define SYS_sigaltstack __NR_sigaltstack
  4602. +#define SYS_timer_create __NR_timer_create
  4603. +#define SYS_mq_notify __NR_mq_notify
  4604. +#define SYS_kexec_load __NR_kexec_load
  4605. +#define SYS_waitid __NR_waitid
  4606. +#define SYS_set_robust_list __NR_set_robust_list
  4607. +#define SYS_get_robust_list __NR_get_robust_list
  4608. +#define SYS_vmsplice __NR_vmsplice
  4609. +#define SYS_move_pages __NR_move_pages
  4610. +#define SYS_preadv __NR_preadv
  4611. +#define SYS_pwritev __NR_pwritev
  4612. +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
  4613. +#define SYS_recvmmsg __NR_recvmmsg
  4614. +#define SYS_sendmmsg __NR_sendmmsg
  4615. +#define SYS_process_vm_readv __NR_process_vm_readv
  4616. +#define SYS_process_vm_writev __NR_process_vm_writev
  4617. +#define SYS_setsockopt __NR_setsockopt
  4618. +#define SYS_getsockopt __NR_getsockopt
  4619. +
  4620. +#undef SYS_fstatat
  4621. +#undef SYS_pread
  4622. +#undef SYS_pwrite
  4623. +#undef SYS_getdents
  4624. +#define SYS_fstatat SYS_newfstatat
  4625. +#define SYS_pread SYS_pread64
  4626. +#define SYS_pwrite SYS_pwrite64
  4627. +#define SYS_getdents SYS_getdents64
  4628. +#define SYS_fadvise SYS_fadvise64
  4629. diff -Nur musl-0.9.15/arch/x32/bits/termios.h musl-git/arch/x32/bits/termios.h
  4630. --- musl-0.9.15/arch/x32/bits/termios.h 1970-01-01 01:00:00.000000000 +0100
  4631. +++ musl-git/arch/x32/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  4632. @@ -0,0 +1,160 @@
  4633. +struct termios
  4634. +{
  4635. + tcflag_t c_iflag;
  4636. + tcflag_t c_oflag;
  4637. + tcflag_t c_cflag;
  4638. + tcflag_t c_lflag;
  4639. + cc_t c_line;
  4640. + cc_t c_cc[NCCS];
  4641. + speed_t __c_ispeed;
  4642. + speed_t __c_ospeed;
  4643. +};
  4644. +
  4645. +#define VINTR 0
  4646. +#define VQUIT 1
  4647. +#define VERASE 2
  4648. +#define VKILL 3
  4649. +#define VEOF 4
  4650. +#define VTIME 5
  4651. +#define VMIN 6
  4652. +#define VSWTC 7
  4653. +#define VSTART 8
  4654. +#define VSTOP 9
  4655. +#define VSUSP 10
  4656. +#define VEOL 11
  4657. +#define VREPRINT 12
  4658. +#define VDISCARD 13
  4659. +#define VWERASE 14
  4660. +#define VLNEXT 15
  4661. +#define VEOL2 16
  4662. +
  4663. +#define IGNBRK 0000001
  4664. +#define BRKINT 0000002
  4665. +#define IGNPAR 0000004
  4666. +#define PARMRK 0000010
  4667. +#define INPCK 0000020
  4668. +#define ISTRIP 0000040
  4669. +#define INLCR 0000100
  4670. +#define IGNCR 0000200
  4671. +#define ICRNL 0000400
  4672. +#define IUCLC 0001000
  4673. +#define IXON 0002000
  4674. +#define IXANY 0004000
  4675. +#define IXOFF 0010000
  4676. +#define IMAXBEL 0020000
  4677. +#define IUTF8 0040000
  4678. +
  4679. +#define OPOST 0000001
  4680. +#define OLCUC 0000002
  4681. +#define ONLCR 0000004
  4682. +#define OCRNL 0000010
  4683. +#define ONOCR 0000020
  4684. +#define ONLRET 0000040
  4685. +#define OFILL 0000100
  4686. +#define OFDEL 0000200
  4687. +#define NLDLY 0000400
  4688. +#define NL0 0000000
  4689. +#define NL1 0000400
  4690. +#define CRDLY 0003000
  4691. +#define CR0 0000000
  4692. +#define CR1 0001000
  4693. +#define CR2 0002000
  4694. +#define CR3 0003000
  4695. +#define TABDLY 0014000
  4696. +#define TAB0 0000000
  4697. +#define TAB1 0004000
  4698. +#define TAB2 0010000
  4699. +#define TAB3 0014000
  4700. +#define BSDLY 0020000
  4701. +#define BS0 0000000
  4702. +#define BS1 0020000
  4703. +#define FFDLY 0100000
  4704. +#define FF0 0000000
  4705. +#define FF1 0100000
  4706. +
  4707. +#define VTDLY 0040000
  4708. +#define VT0 0000000
  4709. +#define VT1 0040000
  4710. +
  4711. +#define B0 0000000
  4712. +#define B50 0000001
  4713. +#define B75 0000002
  4714. +#define B110 0000003
  4715. +#define B134 0000004
  4716. +#define B150 0000005
  4717. +#define B200 0000006
  4718. +#define B300 0000007
  4719. +#define B600 0000010
  4720. +#define B1200 0000011
  4721. +#define B1800 0000012
  4722. +#define B2400 0000013
  4723. +#define B4800 0000014
  4724. +#define B9600 0000015
  4725. +#define B19200 0000016
  4726. +#define B38400 0000017
  4727. +
  4728. +#define B57600 0010001
  4729. +#define B115200 0010002
  4730. +#define B230400 0010003
  4731. +#define B460800 0010004
  4732. +#define B500000 0010005
  4733. +#define B576000 0010006
  4734. +#define B921600 0010007
  4735. +#define B1000000 0010010
  4736. +#define B1152000 0010011
  4737. +#define B1500000 0010012
  4738. +#define B2000000 0010013
  4739. +#define B2500000 0010014
  4740. +#define B3000000 0010015
  4741. +#define B3500000 0010016
  4742. +#define B4000000 0010017
  4743. +
  4744. +#define CBAUD 0010017
  4745. +
  4746. +#define CSIZE 0000060
  4747. +#define CS5 0000000
  4748. +#define CS6 0000020
  4749. +#define CS7 0000040
  4750. +#define CS8 0000060
  4751. +#define CSTOPB 0000100
  4752. +#define CREAD 0000200
  4753. +#define PARENB 0000400
  4754. +#define PARODD 0001000
  4755. +#define HUPCL 0002000
  4756. +#define CLOCAL 0004000
  4757. +
  4758. +#define ISIG 0000001
  4759. +#define ICANON 0000002
  4760. +#define ECHO 0000010
  4761. +#define ECHOE 0000020
  4762. +#define ECHOK 0000040
  4763. +#define ECHONL 0000100
  4764. +#define NOFLSH 0000200
  4765. +#define TOSTOP 0000400
  4766. +#define IEXTEN 0100000
  4767. +
  4768. +#define ECHOCTL 0001000
  4769. +#define ECHOPRT 0002000
  4770. +#define ECHOKE 0004000
  4771. +#define FLUSHO 0010000
  4772. +#define PENDIN 0040000
  4773. +
  4774. +#define TCOOFF 0
  4775. +#define TCOON 1
  4776. +#define TCIOFF 2
  4777. +#define TCION 3
  4778. +
  4779. +#define TCIFLUSH 0
  4780. +#define TCOFLUSH 1
  4781. +#define TCIOFLUSH 2
  4782. +
  4783. +#define TCSANOW 0
  4784. +#define TCSADRAIN 1
  4785. +#define TCSAFLUSH 2
  4786. +
  4787. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  4788. +#define CBAUDEX 0010000
  4789. +#define CRTSCTS 020000000000
  4790. +#define EXTPROC 0200000
  4791. +#define XTABS 0014000
  4792. +#endif
  4793. diff -Nur musl-0.9.15/arch/x32/bits/user.h musl-git/arch/x32/bits/user.h
  4794. --- musl-0.9.15/arch/x32/bits/user.h 1970-01-01 01:00:00.000000000 +0100
  4795. +++ musl-git/arch/x32/bits/user.h 2014-03-19 07:42:48.000000000 +0100
  4796. @@ -0,0 +1,44 @@
  4797. +#undef __WORDSIZE
  4798. +#define __WORDSIZE 64
  4799. +
  4800. +typedef struct user_fpregs_struct
  4801. +{
  4802. + uint16_t cwd, swd, ftw, fop;
  4803. + uint64_t rip, rdp;
  4804. + uint32_t mxcsr, mxcs_mask;
  4805. + uint32_t st_space[32], xmm_space[64], padding[24];
  4806. +} elf_fpregset_t;
  4807. +
  4808. +struct user_regs_struct
  4809. +{
  4810. + unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
  4811. + unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
  4812. + unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
  4813. +};
  4814. +#define ELF_NGREG 27
  4815. +typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
  4816. +
  4817. +struct user
  4818. +{
  4819. + struct user_regs_struct regs;
  4820. + int u_fpvalid;
  4821. + struct user_fpregs_struct i387;
  4822. + unsigned long u_tsize;
  4823. + unsigned long u_dsize;
  4824. + unsigned long u_ssize;
  4825. + unsigned long start_code;
  4826. + unsigned long start_stack;
  4827. + long signal;
  4828. + int reserved;
  4829. + struct user_regs_struct *u_ar0;
  4830. + struct user_fpregs_struct *u_fpstate;
  4831. + unsigned long magic;
  4832. + char u_comm[32];
  4833. + unsigned long u_debugreg[8];
  4834. +};
  4835. +
  4836. +#define PAGE_MASK (~(PAGE_SIZE-1))
  4837. +#define NBPG PAGE_SIZE
  4838. +#define UPAGES 1
  4839. +#define HOST_TEXT_START_ADDR (u.start_code)
  4840. +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
  4841. diff -Nur musl-0.9.15/arch/x32/crt_arch.h musl-git/arch/x32/crt_arch.h
  4842. --- musl-0.9.15/arch/x32/crt_arch.h 1970-01-01 01:00:00.000000000 +0100
  4843. +++ musl-git/arch/x32/crt_arch.h 2014-03-19 07:42:48.000000000 +0100
  4844. @@ -0,0 +1,9 @@
  4845. +__asm__("\
  4846. +.text \n\
  4847. +.global _start \n\
  4848. +_start: \n\
  4849. + xor %rbp,%rbp \n\
  4850. + mov %rsp,%rdi \n\
  4851. + andq $-16,%rsp \n\
  4852. + call __cstart \n\
  4853. +");
  4854. diff -Nur musl-0.9.15/arch/x32/pthread_arch.h musl-git/arch/x32/pthread_arch.h
  4855. --- musl-0.9.15/arch/x32/pthread_arch.h 1970-01-01 01:00:00.000000000 +0100
  4856. +++ musl-git/arch/x32/pthread_arch.h 2014-03-19 07:42:48.000000000 +0100
  4857. @@ -0,0 +1,10 @@
  4858. +static inline struct pthread *__pthread_self()
  4859. +{
  4860. + struct pthread *self;
  4861. + __asm__ __volatile__ ("mov %%fs:0,%0" : "=r" (self) );
  4862. + return self;
  4863. +}
  4864. +
  4865. +#define TP_ADJ(p) (p)
  4866. +
  4867. +#define CANCEL_REG_IP 16
  4868. diff -Nur musl-0.9.15/arch/x32/reloc.h musl-git/arch/x32/reloc.h
  4869. --- musl-0.9.15/arch/x32/reloc.h 1970-01-01 01:00:00.000000000 +0100
  4870. +++ musl-git/arch/x32/reloc.h 2014-03-19 07:42:48.000000000 +0100
  4871. @@ -0,0 +1,46 @@
  4872. +#include <stdint.h>
  4873. +#include <string.h>
  4874. +#include <elf.h>
  4875. +
  4876. +#define LDSO_ARCH "x32"
  4877. +
  4878. +#define IS_COPY(x) ((x)==R_X86_64_COPY)
  4879. +#define IS_PLT(x) ((x)==R_X86_64_JUMP_SLOT)
  4880. +
  4881. +static inline void do_single_reloc(
  4882. + struct dso *self, unsigned char *base_addr,
  4883. + size_t *reloc_addr, int type, size_t addend,
  4884. + Sym *sym, size_t sym_size,
  4885. + struct symdef def, size_t sym_val)
  4886. +{
  4887. + switch(type) {
  4888. + case R_X86_64_GLOB_DAT:
  4889. + case R_X86_64_JUMP_SLOT:
  4890. + case R_X86_64_64:
  4891. + *reloc_addr = sym_val + addend;
  4892. + break;
  4893. + case R_X86_64_32:
  4894. + *(uint32_t *)reloc_addr = sym_val + addend;
  4895. + break;
  4896. + case R_X86_64_PC32:
  4897. + *reloc_addr = sym_val + addend - (size_t)reloc_addr + (size_t)base_addr;
  4898. + break;
  4899. + case R_X86_64_RELATIVE:
  4900. + *reloc_addr = (size_t)base_addr + addend;
  4901. + break;
  4902. + case R_X86_64_COPY:
  4903. + memcpy(reloc_addr, (void *)sym_val, sym_size);
  4904. + break;
  4905. + case R_X86_64_DTPMOD64:
  4906. + *reloc_addr = def.dso ? def.dso->tls_id : self->tls_id;
  4907. + break;
  4908. + case R_X86_64_DTPOFF64:
  4909. + *reloc_addr = def.sym->st_value + addend;
  4910. + break;
  4911. + case R_X86_64_TPOFF64:
  4912. + *reloc_addr = (def.sym
  4913. + ? def.sym->st_value - def.dso->tls_offset
  4914. + : 0 - self->tls_offset) + addend;
  4915. + break;
  4916. + }
  4917. +}
  4918. diff -Nur musl-0.9.15/arch/x32/src/syscall_cp_fixup.c musl-git/arch/x32/src/syscall_cp_fixup.c
  4919. --- musl-0.9.15/arch/x32/src/syscall_cp_fixup.c 1970-01-01 01:00:00.000000000 +0100
  4920. +++ musl-git/arch/x32/src/syscall_cp_fixup.c 2014-03-19 07:42:48.000000000 +0100
  4921. @@ -0,0 +1,31 @@
  4922. +#include <sys/syscall.h>
  4923. +long __syscall_cp_internal(volatile void*, long long, long long, long long, long long,
  4924. + long long, long long, long long);
  4925. +
  4926. +struct __timespec { long long tv_sec; long tv_nsec; };
  4927. +struct __timespec_kernel { long long tv_sec; long long tv_nsec; };
  4928. +#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
  4929. +#define __fixup(X) do { if(X) X = (unsigned long) (&(struct __timespec_kernel) \
  4930. + { .tv_sec = __tsc(X)->tv_sec, .tv_nsec = __tsc(X)->tv_nsec}); } while(0)
  4931. +
  4932. +long __syscall_cp_asm (volatile void * foo, long long n, long long a1, long long a2, long long a3,
  4933. + long long a4, long long a5, long long a6) {
  4934. + switch (n) {
  4935. + case SYS_mq_timedsend: case SYS_mq_timedreceive: case SYS_pselect6:
  4936. + __fixup(a5);
  4937. + break;
  4938. + case SYS_futex:
  4939. + if((a2 & (~128 /* FUTEX_PRIVATE_FLAG */)) == 0 /* FUTEX_WAIT */)
  4940. + __fixup(a4);
  4941. + break;
  4942. + case SYS_clock_nanosleep:
  4943. + case SYS_rt_sigtimedwait: case SYS_ppoll:
  4944. + __fixup(a3);
  4945. + break;
  4946. + case SYS_nanosleep:
  4947. + __fixup(a1);
  4948. + break;
  4949. + }
  4950. + return __syscall_cp_internal(foo, n, a1, a2, a3, a4, a5, a6);
  4951. +}
  4952. +
  4953. diff -Nur musl-0.9.15/arch/x32/src/sysinfo.c musl-git/arch/x32/src/sysinfo.c
  4954. --- musl-0.9.15/arch/x32/src/sysinfo.c 1970-01-01 01:00:00.000000000 +0100
  4955. +++ musl-git/arch/x32/src/sysinfo.c 2014-03-19 07:42:48.000000000 +0100
  4956. @@ -0,0 +1,47 @@
  4957. +#include <sys/sysinfo.h>
  4958. +#include "syscall.h"
  4959. +
  4960. +#define klong long long
  4961. +#define kulong unsigned long long
  4962. +
  4963. +struct kernel_sysinfo {
  4964. + klong uptime;
  4965. + kulong loads[3];
  4966. + kulong totalram;
  4967. + kulong freeram;
  4968. + kulong sharedram;
  4969. + kulong bufferram;
  4970. + kulong totalswap;
  4971. + kulong freeswap;
  4972. + short procs;
  4973. + short pad;
  4974. + kulong totalhigh;
  4975. + kulong freehigh;
  4976. + unsigned mem_unit;
  4977. +};
  4978. +
  4979. +int __x32_sysinfo(struct sysinfo *info)
  4980. +{
  4981. + struct kernel_sysinfo tmp;
  4982. + int ret = syscall(SYS_sysinfo, &tmp);
  4983. + if(ret == -1) return ret;
  4984. + info->uptime = tmp.uptime;
  4985. + info->loads[0] = tmp.loads[0];
  4986. + info->loads[1] = tmp.loads[1];
  4987. + info->loads[2] = tmp.loads[2];
  4988. + kulong shifts;
  4989. + kulong max = tmp.totalram | tmp.totalswap;
  4990. + __asm__("bsr %1,%0" : "=r"(shifts) : "r"(max));
  4991. + shifts = shifts >= 32 ? shifts - 31 : 0;
  4992. + info->totalram = tmp.totalram >> shifts;
  4993. + info->freeram = tmp.freeram >> shifts;
  4994. + info->sharedram = tmp.sharedram >> shifts;
  4995. + info->bufferram = tmp.bufferram >> shifts;
  4996. + info->totalswap = tmp.totalswap >> shifts;
  4997. + info->freeswap = tmp.freeswap >> shifts;
  4998. + info->procs = tmp.procs ;
  4999. + info->totalhigh = tmp.totalhigh >> shifts;
  5000. + info->freehigh = tmp.freehigh >> shifts;
  5001. + info->mem_unit = (tmp.mem_unit ? tmp.mem_unit : 1) << shifts;
  5002. + return ret;
  5003. +}
  5004. diff -Nur musl-0.9.15/arch/x32/syscall_arch.h musl-git/arch/x32/syscall_arch.h
  5005. --- musl-0.9.15/arch/x32/syscall_arch.h 1970-01-01 01:00:00.000000000 +0100
  5006. +++ musl-git/arch/x32/syscall_arch.h 2014-03-19 07:42:48.000000000 +0100
  5007. @@ -0,0 +1,117 @@
  5008. +#define __SYSCALL_LL_E(x) (x)
  5009. +#define __SYSCALL_LL_O(x) (x)
  5010. +
  5011. +#define __scc(X) sizeof(1?(X):0ULL) < 8 ? (unsigned long) (X) : (long long) (X)
  5012. +typedef long long syscall_arg_t;
  5013. +struct __timespec { long long tv_sec; long tv_nsec; };
  5014. +struct __timespec_kernel { long long tv_sec; long long tv_nsec; };
  5015. +#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
  5016. +#define __fixup(X) do { if(X) X = (unsigned long) (&(struct __timespec_kernel) \
  5017. + { .tv_sec = __tsc(X)->tv_sec, .tv_nsec = __tsc(X)->tv_nsec}); } while(0)
  5018. +#define __fixup_case_2 \
  5019. + case SYS_nanosleep: \
  5020. + __fixup(a1); break; \
  5021. + case SYS_clock_settime: \
  5022. + __fixup(a2); break;
  5023. +#define __fixup_case_3 \
  5024. + case SYS_clock_nanosleep: case SYS_rt_sigtimedwait: case SYS_ppoll: \
  5025. + __fixup(a3); break; \
  5026. + case SYS_utimensat: \
  5027. + if(a3) a3 = (unsigned long) ((struct __timespec_kernel[2]) { \
  5028. + [0] = {.tv_sec = __tsc(a3)[0].tv_sec, .tv_nsec = __tsc(a3)[0].tv_nsec}, \
  5029. + [1] = {.tv_sec = __tsc(a3)[1].tv_sec, .tv_nsec = __tsc(a3)[1].tv_nsec}, \
  5030. + }); break;
  5031. +#define __fixup_case_4 \
  5032. + case SYS_futex: \
  5033. + if((a2 & (~128 /* FUTEX_PRIVATE_FLAG */)) == 0 /* FUTEX_WAIT */) __fixup(a4); break;
  5034. +#define __fixup_case_5 \
  5035. + case SYS_mq_timedsend: case SYS_mq_timedreceive: case SYS_pselect6: \
  5036. + __fixup(a5); break;
  5037. +
  5038. +static __inline long __syscall0(long long n)
  5039. +{
  5040. + unsigned long ret;
  5041. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n) : "rcx", "r11", "memory");
  5042. + return ret;
  5043. +}
  5044. +
  5045. +static __inline long __syscall1(long long n, long long a1)
  5046. +{
  5047. + unsigned long ret;
  5048. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1) : "rcx", "r11", "memory");
  5049. + return ret;
  5050. +}
  5051. +
  5052. +static __inline long __syscall2(long long n, long long a1, long long a2)
  5053. +{
  5054. + unsigned long ret;
  5055. + struct __timespec *ts2 = 0;
  5056. + switch (n) {
  5057. + __fixup_case_2;
  5058. + }
  5059. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2)
  5060. + : "rcx", "r11", "memory");
  5061. + return ret;
  5062. +}
  5063. +
  5064. +static __inline long __syscall3(long long n, long long a1, long long a2, long long a3)
  5065. +{
  5066. + unsigned long ret;
  5067. + switch (n) {
  5068. + __fixup_case_2;
  5069. + __fixup_case_3;
  5070. + }
  5071. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  5072. + "d"(a3) : "rcx", "r11", "memory");
  5073. + return ret;
  5074. +}
  5075. +
  5076. +static __inline long __syscall4(long long n, long long a1, long long a2, long long a3,
  5077. + long long a4_)
  5078. +{
  5079. + unsigned long ret;
  5080. + register long long a4 __asm__("r10") = a4_;
  5081. + switch (n) {
  5082. + __fixup_case_2;
  5083. + __fixup_case_3;
  5084. + __fixup_case_4;
  5085. + }
  5086. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  5087. + "d"(a3), "r"(a4): "rcx", "r11", "memory");
  5088. + return ret;
  5089. +}
  5090. +
  5091. +static __inline long __syscall5(long long n, long long a1, long long a2, long long a3,
  5092. + long long a4_, long long a5_)
  5093. +{
  5094. + unsigned long ret;
  5095. + register long long a4 __asm__("r10") = a4_;
  5096. + register long long a5 __asm__("r8") = a5_;
  5097. + switch (n) {
  5098. + __fixup_case_2;
  5099. + __fixup_case_3;
  5100. + __fixup_case_4;
  5101. + __fixup_case_5;
  5102. + }
  5103. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  5104. + "d"(a3), "r"(a4), "r"(a5) : "rcx", "r11", "memory");
  5105. + return ret;
  5106. +}
  5107. +
  5108. +static __inline long __syscall6(long long n, long long a1, long long a2, long long a3,
  5109. + long long a4_, long long a5_, long long a6_)
  5110. +{
  5111. + unsigned long ret;
  5112. + register long long a4 __asm__("r10") = a4_;
  5113. + register long long a5 __asm__("r8") = a5_;
  5114. + register long long a6 __asm__("r9") = a6_;
  5115. + switch (n) {
  5116. + __fixup_case_2;
  5117. + __fixup_case_3;
  5118. + __fixup_case_4;
  5119. + __fixup_case_5;
  5120. + }
  5121. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  5122. + "d"(a3), "r"(a4), "r"(a5), "r"(a6) : "rcx", "r11", "memory");
  5123. + return ret;
  5124. +}
  5125. diff -Nur musl-0.9.15/arch/x86_64/atomic.h musl-git/arch/x86_64/atomic.h
  5126. --- musl-0.9.15/arch/x86_64/atomic.h 2014-01-03 21:12:17.000000000 +0100
  5127. +++ musl-git/arch/x86_64/atomic.h 2014-03-19 07:42:48.000000000 +0100
  5128. @@ -5,38 +5,36 @@
  5129. static inline int a_ctz_64(uint64_t x)
  5130. {
  5131. - long r;
  5132. - __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
  5133. - return r;
  5134. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  5135. + return x;
  5136. }
  5137. static inline int a_ctz_l(unsigned long x)
  5138. {
  5139. - long r;
  5140. - __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
  5141. - return r;
  5142. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  5143. + return x;
  5144. }
  5145. static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  5146. {
  5147. - __asm__( "lock ; andq %1, %0"
  5148. - : "=m"(*(long *)p) : "r"(v) : "memory" );
  5149. + __asm__( "lock ; and %1, %0"
  5150. + : "=m"(*p) : "r"(v) : "memory" );
  5151. }
  5152. static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  5153. {
  5154. - __asm__( "lock ; orq %1, %0"
  5155. - : "=m"(*(long *)p) : "r"(v) : "memory" );
  5156. + __asm__( "lock ; or %1, %0"
  5157. + : "=m"(*p) : "r"(v) : "memory" );
  5158. }
  5159. static inline void a_store_l(volatile void *p, long x)
  5160. {
  5161. - __asm__( "movq %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  5162. + __asm__( "mov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  5163. }
  5164. static inline void a_or_l(volatile void *p, long v)
  5165. {
  5166. - __asm__( "lock ; orq %1, %0"
  5167. + __asm__( "lock ; or %1, %0"
  5168. : "=m"(*(long *)p) : "r"(v) : "memory" );
  5169. }
  5170. @@ -56,7 +54,7 @@
  5171. static inline int a_cas(volatile int *p, int t, int s)
  5172. {
  5173. - __asm__( "lock ; cmpxchgl %3, %1"
  5174. + __asm__( "lock ; cmpxchg %3, %1"
  5175. : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
  5176. return t;
  5177. }
  5178. @@ -74,13 +72,13 @@
  5179. static inline void a_or(volatile void *p, int v)
  5180. {
  5181. - __asm__( "lock ; orl %1, %0"
  5182. + __asm__( "lock ; or %1, %0"
  5183. : "=m"(*(int *)p) : "r"(v) : "memory" );
  5184. }
  5185. static inline void a_and(volatile void *p, int v)
  5186. {
  5187. - __asm__( "lock ; andl %1, %0"
  5188. + __asm__( "lock ; and %1, %0"
  5189. : "=m"(*(int *)p) : "r"(v) : "memory" );
  5190. }
  5191. @@ -110,7 +108,7 @@
  5192. static inline void a_store(volatile int *p, int x)
  5193. {
  5194. - __asm__( "movl %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  5195. + __asm__( "mov %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  5196. }
  5197. static inline void a_spin()
  5198. diff -Nur musl-0.9.15/arch/x86_64/bits/sem.h musl-git/arch/x86_64/bits/sem.h
  5199. --- musl-0.9.15/arch/x86_64/bits/sem.h 1970-01-01 01:00:00.000000000 +0100
  5200. +++ musl-git/arch/x86_64/bits/sem.h 2014-03-19 07:42:48.000000000 +0100
  5201. @@ -0,0 +1,16 @@
  5202. +struct semid_ds {
  5203. + struct ipc_perm sem_perm;
  5204. + time_t sem_otime;
  5205. + time_t __unused1;
  5206. + time_t sem_ctime;
  5207. + time_t __unused2;
  5208. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  5209. + unsigned short sem_nsems;
  5210. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  5211. +#else
  5212. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  5213. + unsigned short sem_nsems;
  5214. +#endif
  5215. + time_t __unused3;
  5216. + time_t __unused4;
  5217. +};
  5218. diff -Nur musl-0.9.15/arch/x86_64/bits/shm.h musl-git/arch/x86_64/bits/shm.h
  5219. --- musl-0.9.15/arch/x86_64/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  5220. +++ musl-git/arch/x86_64/bits/shm.h 2014-03-19 07:42:48.000000000 +0100
  5221. @@ -13,3 +13,14 @@
  5222. unsigned long __pad1;
  5223. unsigned long __pad2;
  5224. };
  5225. +
  5226. +struct shminfo {
  5227. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  5228. +};
  5229. +
  5230. +struct shm_info {
  5231. + int __used_ids;
  5232. + unsigned long shm_tot, shm_rss, shm_swp;
  5233. + unsigned long __swap_attempts, __swap_successes;
  5234. +};
  5235. +
  5236. diff -Nur musl-0.9.15/arch/x86_64/bits/signal.h musl-git/arch/x86_64/bits/signal.h
  5237. --- musl-0.9.15/arch/x86_64/bits/signal.h 2014-01-03 21:12:17.000000000 +0100
  5238. +++ musl-git/arch/x86_64/bits/signal.h 2014-03-19 07:42:48.000000000 +0100
  5239. @@ -60,6 +60,12 @@
  5240. } mcontext_t;
  5241. #endif
  5242. +struct sigaltstack {
  5243. + void *ss_sp;
  5244. + int ss_flags;
  5245. + size_t ss_size;
  5246. +};
  5247. +
  5248. typedef struct __ucontext {
  5249. unsigned long uc_flags;
  5250. struct __ucontext *uc_link;
  5251. diff -Nur musl-0.9.15/arch/x86_64/bits/stat.h musl-git/arch/x86_64/bits/stat.h
  5252. --- musl-0.9.15/arch/x86_64/bits/stat.h 2014-01-03 21:12:17.000000000 +0100
  5253. +++ musl-git/arch/x86_64/bits/stat.h 2014-03-19 07:42:48.000000000 +0100
  5254. @@ -2,7 +2,7 @@
  5255. * by the corresponding correctly-sized userspace types. */
  5256. struct stat {
  5257. - unsigned long st_dev;
  5258. + dev_t st_dev;
  5259. ino_t st_ino;
  5260. nlink_t st_nlink;
  5261. diff -Nur musl-0.9.15/arch/x86_64/bits/termios.h musl-git/arch/x86_64/bits/termios.h
  5262. --- musl-0.9.15/arch/x86_64/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  5263. +++ musl-git/arch/x86_64/bits/termios.h 2014-03-19 07:42:48.000000000 +0100
  5264. @@ -42,6 +42,7 @@
  5265. #define IXANY 0004000
  5266. #define IXOFF 0010000
  5267. #define IMAXBEL 0020000
  5268. +#define IUTF8 0040000
  5269. #define OPOST 0000001
  5270. #define OLCUC 0000002
  5271. @@ -75,9 +76,6 @@
  5272. #define VT0 0000000
  5273. #define VT1 0040000
  5274. -/* ?? */
  5275. -#define XTABS 0014000
  5276. -
  5277. #define B0 0000000
  5278. #define B50 0000001
  5279. #define B75 0000002
  5280. @@ -125,8 +123,6 @@
  5281. #define HUPCL 0002000
  5282. #define CLOCAL 0004000
  5283. -#define CRTSCTS 020000000000
  5284. -
  5285. #define ISIG 0000001
  5286. #define ICANON 0000002
  5287. #define ECHO 0000010
  5288. @@ -137,14 +133,11 @@
  5289. #define TOSTOP 0000400
  5290. #define IEXTEN 0100000
  5291. -/* Extensions? */
  5292. -#define CBAUDEX 0010000
  5293. #define ECHOCTL 0001000
  5294. #define ECHOPRT 0002000
  5295. #define ECHOKE 0004000
  5296. #define FLUSHO 0010000
  5297. #define PENDIN 0040000
  5298. -#define EXTPROC 0200000
  5299. #define TCOOFF 0
  5300. #define TCOON 1
  5301. @@ -158,3 +151,10 @@
  5302. #define TCSANOW 0
  5303. #define TCSADRAIN 1
  5304. #define TCSAFLUSH 2
  5305. +
  5306. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5307. +#define CBAUDEX 0010000
  5308. +#define CRTSCTS 020000000000
  5309. +#define EXTPROC 0200000
  5310. +#define XTABS 0014000
  5311. +#endif
  5312. diff -Nur musl-0.9.15/arch/x86_64/pthread_arch.h musl-git/arch/x86_64/pthread_arch.h
  5313. --- musl-0.9.15/arch/x86_64/pthread_arch.h 2014-01-03 21:12:17.000000000 +0100
  5314. +++ musl-git/arch/x86_64/pthread_arch.h 2014-03-19 07:42:48.000000000 +0100
  5315. @@ -1,7 +1,7 @@
  5316. static inline struct pthread *__pthread_self()
  5317. {
  5318. struct pthread *self;
  5319. - __asm__ __volatile__ ("movq %%fs:0,%0" : "=r" (self) );
  5320. + __asm__ __volatile__ ("mov %%fs:0,%0" : "=r" (self) );
  5321. return self;
  5322. }
  5323. diff -Nur musl-0.9.15/configure musl-git/configure
  5324. --- musl-0.9.15/configure 2014-01-03 21:12:17.000000000 +0100
  5325. +++ musl-git/configure 2014-03-19 07:42:48.000000000 +0100
  5326. @@ -222,12 +222,16 @@
  5327. # Convert to just ARCH
  5328. #
  5329. case "$target" in
  5330. +# Catch these early to simplify matching for 32-bit archs
  5331. +mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;;
  5332. arm*) ARCH=arm ;;
  5333. i?86*) ARCH=i386 ;;
  5334. +x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;;
  5335. x86_64*) ARCH=x86_64 ;;
  5336. -mips-*|mipsel-*) ARCH=mips ;;
  5337. -microblaze-*) ARCH=microblaze ;;
  5338. -powerpc-*) ARCH=powerpc ;;
  5339. +mips*) ARCH=mips ;;
  5340. +microblaze*) ARCH=microblaze ;;
  5341. +powerpc*) ARCH=powerpc ;;
  5342. +sh[1-9bel-]*|sh|superh*) ARCH=sh ;;
  5343. unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
  5344. *) fail "$0: unknown or unsupported target \"$target\"" ;;
  5345. esac
  5346. @@ -381,6 +385,7 @@
  5347. tryflag CFLAGS_AUTO -Wno-unused-value
  5348. tryflag CFLAGS_AUTO -Wno-unused-but-set-variable
  5349. tryflag CFLAGS_AUTO -Wno-unknown-pragmas
  5350. +tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast
  5351. fi
  5352. # Some patched GCC builds have these defaults messed up...
  5353. @@ -410,12 +415,33 @@
  5354. trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf
  5355. fi
  5356. -test "$ARCH" = "mips" && trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" \
  5357. -&& SUBARCH=${SUBARCH}el
  5358. +if test "$ARCH" = "mips" ; then
  5359. +trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el
  5360. +trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf
  5361. +fi
  5362. test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \
  5363. && SUBARCH=${SUBARCH}el
  5364. +if test "$ARCH" = "sh" ; then
  5365. +trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb
  5366. +if trycppif __SH_FPU_ANY__ "$t" ; then
  5367. +# Some sh configurations are broken and replace double with float
  5368. +# rather than using softfloat when the fpu is present but only
  5369. +# supports single precision. Reject them.
  5370. +printf "checking whether compiler's double type is IEEE double... "
  5371. +echo 'typedef char dblcheck[(int)sizeof(double)-5];' > "$tmpc"
  5372. +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
  5373. +printf "yes\n"
  5374. +else
  5375. +printf "no\n"
  5376. +fail "$0: error: compiler's floating point configuration is unsupported"
  5377. +fi
  5378. +else
  5379. +SUBARCH=${SUBARCH}-nofpu
  5380. +fi
  5381. +fi
  5382. +
  5383. test "$SUBARCH" \
  5384. && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH"
  5385. diff -Nur musl-0.9.15/COPYRIGHT musl-git/COPYRIGHT
  5386. --- musl-0.9.15/COPYRIGHT 2014-01-03 21:12:17.000000000 +0100
  5387. +++ musl-git/COPYRIGHT 2014-03-19 07:42:48.000000000 +0100
  5388. @@ -1,6 +1,6 @@
  5389. musl as a whole is licensed under the following standard MIT license:
  5390. -Copyright © 2005-2013 Rich Felker
  5391. +Copyright © 2005-2014 Rich Felker
  5392. Permission is hereby granted, free of charge, to any person obtaining
  5393. a copy of this software and associated documentation files (the
  5394. @@ -79,7 +79,7 @@
  5395. from Bionic libc, used on Android.
  5396. All other files which have no copyright comments are original works
  5397. -Copyright © 2005-2013 Rich Felker, the main author of this library.
  5398. +Copyright © 2005-2014 Rich Felker, the main author of this library.
  5399. The decision to exclude such comments is intentional, as it should be
  5400. possible to carry around the complete source code on tiny storage
  5401. media. All public header files (include/* and arch/*/bits/*) should be
  5402. diff -Nur musl-0.9.15/crt/superh/crti.s musl-git/crt/superh/crti.s
  5403. --- musl-0.9.15/crt/superh/crti.s 1970-01-01 01:00:00.000000000 +0100
  5404. +++ musl-git/crt/superh/crti.s 2014-03-19 07:42:48.000000000 +0100
  5405. @@ -0,0 +1,13 @@
  5406. +.section .init
  5407. +.global _init
  5408. +.type _init, @function
  5409. +_init:
  5410. + sts.l pr, @-r15
  5411. + nop
  5412. +
  5413. +.section .fini
  5414. +.global _fini
  5415. +.type _fini, @function
  5416. +_fini:
  5417. + sts.l pr, @-r15
  5418. + nop
  5419. diff -Nur musl-0.9.15/crt/superh/crtn.s musl-git/crt/superh/crtn.s
  5420. --- musl-0.9.15/crt/superh/crtn.s 1970-01-01 01:00:00.000000000 +0100
  5421. +++ musl-git/crt/superh/crtn.s 2014-03-19 07:42:48.000000000 +0100
  5422. @@ -0,0 +1,9 @@
  5423. +.section .init
  5424. + lds.l @r15+, pr
  5425. + rts
  5426. + nop
  5427. +
  5428. +.section .fini
  5429. + lds.l @r15+, pr
  5430. + rts
  5431. + nop
  5432. diff -Nur musl-0.9.15/crt/x32/crti.s musl-git/crt/x32/crti.s
  5433. --- musl-0.9.15/crt/x32/crti.s 1970-01-01 01:00:00.000000000 +0100
  5434. +++ musl-git/crt/x32/crti.s 2014-03-19 07:42:48.000000000 +0100
  5435. @@ -0,0 +1,9 @@
  5436. +.section .init
  5437. +.global _init
  5438. +_init:
  5439. + push %rax
  5440. +
  5441. +.section .fini
  5442. +.global _fini
  5443. +_fini:
  5444. + push %rax
  5445. diff -Nur musl-0.9.15/crt/x32/crtn.s musl-git/crt/x32/crtn.s
  5446. --- musl-0.9.15/crt/x32/crtn.s 1970-01-01 01:00:00.000000000 +0100
  5447. +++ musl-git/crt/x32/crtn.s 2014-03-19 07:42:48.000000000 +0100
  5448. @@ -0,0 +1,7 @@
  5449. +.section .init
  5450. + pop %rax
  5451. + ret
  5452. +
  5453. +.section .fini
  5454. + pop %rax
  5455. + ret
  5456. diff -Nur musl-0.9.15/.gitignore musl-git/.gitignore
  5457. --- musl-0.9.15/.gitignore 1970-01-01 01:00:00.000000000 +0100
  5458. +++ musl-git/.gitignore 2014-03-19 07:42:48.000000000 +0100
  5459. @@ -0,0 +1,11 @@
  5460. +*.o
  5461. +*.lo
  5462. +*.a
  5463. +*.so
  5464. +*.so.1
  5465. +arch/*/bits/alltypes.h
  5466. +config.mak
  5467. +include/bits
  5468. +tools/musl-gcc
  5469. +lib/musl-gcc.specs
  5470. +src/internal/version.h
  5471. diff -Nur musl-0.9.15/include/arpa/inet.h musl-git/include/arpa/inet.h
  5472. --- musl-0.9.15/include/arpa/inet.h 2014-01-03 21:12:17.000000000 +0100
  5473. +++ musl-git/include/arpa/inet.h 2014-03-19 07:42:48.000000000 +0100
  5474. @@ -20,7 +20,7 @@
  5475. const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
  5476. int inet_aton (const char *, struct in_addr *);
  5477. -struct in_addr inet_makeaddr(int, int);
  5478. +struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
  5479. in_addr_t inet_lnaof(struct in_addr);
  5480. in_addr_t inet_netof(struct in_addr);
  5481. diff -Nur musl-0.9.15/include/dlfcn.h musl-git/include/dlfcn.h
  5482. --- musl-0.9.15/include/dlfcn.h 2014-01-03 21:12:17.000000000 +0100
  5483. +++ musl-git/include/dlfcn.h 2014-03-19 07:42:48.000000000 +0100
  5484. @@ -31,7 +31,7 @@
  5485. const char *dli_sname;
  5486. void *dli_saddr;
  5487. } Dl_info;
  5488. -int dladdr(void *, Dl_info *);
  5489. +int dladdr(const void *, Dl_info *);
  5490. int dlinfo(void *, int, void *);
  5491. #endif
  5492. diff -Nur musl-0.9.15/include/elf.h musl-git/include/elf.h
  5493. --- musl-0.9.15/include/elf.h 2014-01-03 21:12:17.000000000 +0100
  5494. +++ musl-git/include/elf.h 2014-03-19 07:42:48.000000000 +0100
  5495. @@ -1153,6 +1153,7 @@
  5496. #define EF_MIPS_64BIT_WHIRL 16
  5497. #define EF_MIPS_ABI2 32
  5498. #define EF_MIPS_ABI_ON32 64
  5499. +#define EF_MIPS_NAN2008 1024
  5500. #define EF_MIPS_ARCH 0xf0000000
  5501. @@ -2092,6 +2093,117 @@
  5502. #define R_AARCH64_NONE 0
  5503. #define R_AARCH64_ABS64 257
  5504. #define R_AARCH64_ABS32 258
  5505. +#define R_AARCH64_ABS16 259
  5506. +#define R_AARCH64_PREL64 260
  5507. +#define R_AARCH64_PREL32 261
  5508. +#define R_AARCH64_PREL16 262
  5509. +#define R_AARCH64_MOVW_UABS_G0 263
  5510. +#define R_AARCH64_MOVW_UABS_G0_NC 264
  5511. +#define R_AARCH64_MOVW_UABS_G1 265
  5512. +#define R_AARCH64_MOVW_UABS_G1_NC 266
  5513. +#define R_AARCH64_MOVW_UABS_G2 267
  5514. +#define R_AARCH64_MOVW_UABS_G2_NC 268
  5515. +#define R_AARCH64_MOVW_UABS_G3 269
  5516. +#define R_AARCH64_MOVW_SABS_G0 270
  5517. +#define R_AARCH64_MOVW_SABS_G1 271
  5518. +#define R_AARCH64_MOVW_SABS_G2 272
  5519. +#define R_AARCH64_LD_PREL_LO19 273
  5520. +#define R_AARCH64_ADR_PREL_LO21 274
  5521. +#define R_AARCH64_ADR_PREL_PG_HI21 275
  5522. +#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
  5523. +#define R_AARCH64_ADD_ABS_LO12_NC 277
  5524. +#define R_AARCH64_LDST8_ABS_LO12_NC 278
  5525. +#define R_AARCH64_TSTBR14 279
  5526. +#define R_AARCH64_CONDBR19 280
  5527. +#define R_AARCH64_JUMP26 282
  5528. +#define R_AARCH64_CALL26 283
  5529. +#define R_AARCH64_LDST16_ABS_LO12_NC 284
  5530. +#define R_AARCH64_LDST32_ABS_LO12_NC 285
  5531. +#define R_AARCH64_LDST64_ABS_LO12_NC 286
  5532. +#define R_AARCH64_MOVW_PREL_G0 287
  5533. +#define R_AARCH64_MOVW_PREL_G0_NC 288
  5534. +#define R_AARCH64_MOVW_PREL_G1 289
  5535. +#define R_AARCH64_MOVW_PREL_G1_NC 290
  5536. +#define R_AARCH64_MOVW_PREL_G2 291
  5537. +#define R_AARCH64_MOVW_PREL_G2_NC 292
  5538. +#define R_AARCH64_MOVW_PREL_G3 293
  5539. +#define R_AARCH64_LDST128_ABS_LO12_NC 299
  5540. +#define R_AARCH64_MOVW_GOTOFF_G0 300
  5541. +#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
  5542. +#define R_AARCH64_MOVW_GOTOFF_G1 302
  5543. +#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
  5544. +#define R_AARCH64_MOVW_GOTOFF_G2 304
  5545. +#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
  5546. +#define R_AARCH64_MOVW_GOTOFF_G3 306
  5547. +#define R_AARCH64_GOTREL64 307
  5548. +#define R_AARCH64_GOTREL32 308
  5549. +#define R_AARCH64_GOT_LD_PREL19 309
  5550. +#define R_AARCH64_LD64_GOTOFF_LO15 310
  5551. +#define R_AARCH64_ADR_GOT_PAGE 311
  5552. +#define R_AARCH64_LD64_GOT_LO12_NC 312
  5553. +#define R_AARCH64_LD64_GOTPAGE_LO15 313
  5554. +#define R_AARCH64_TLSGD_ADR_PREL21 512
  5555. +#define R_AARCH64_TLSGD_ADR_PAGE21 513
  5556. +#define R_AARCH64_TLSGD_ADD_LO12_NC 514
  5557. +#define R_AARCH64_TLSGD_MOVW_G1 515
  5558. +#define R_AARCH64_TLSGD_MOVW_G0_NC 516
  5559. +#define R_AARCH64_TLSLD_ADR_PREL21 517
  5560. +#define R_AARCH64_TLSLD_ADR_PAGE21 518
  5561. +#define R_AARCH64_TLSLD_ADD_LO12_NC 519
  5562. +#define R_AARCH64_TLSLD_MOVW_G1 520
  5563. +#define R_AARCH64_TLSLD_MOVW_G0_NC 521
  5564. +#define R_AARCH64_TLSLD_LD_PREL19 522
  5565. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
  5566. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
  5567. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
  5568. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
  5569. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
  5570. +#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
  5571. +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
  5572. +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
  5573. +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
  5574. +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
  5575. +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
  5576. +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
  5577. +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
  5578. +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
  5579. +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
  5580. +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
  5581. +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
  5582. +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
  5583. +#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
  5584. +#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
  5585. +#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
  5586. +#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
  5587. +#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
  5588. +#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
  5589. +#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
  5590. +#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
  5591. +#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
  5592. +#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
  5593. +#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
  5594. +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
  5595. +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
  5596. +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
  5597. +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
  5598. +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
  5599. +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
  5600. +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
  5601. +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
  5602. +#define R_AARCH64_TLSDESC_LD_PREL19 560
  5603. +#define R_AARCH64_TLSDESC_ADR_PREL21 561
  5604. +#define R_AARCH64_TLSDESC_ADR_PAGE21 562
  5605. +#define R_AARCH64_TLSDESC_LD64_LO12 563
  5606. +#define R_AARCH64_TLSDESC_ADD_LO12 564
  5607. +#define R_AARCH64_TLSDESC_OFF_G1 565
  5608. +#define R_AARCH64_TLSDESC_OFF_G0_NC 566
  5609. +#define R_AARCH64_TLSDESC_LDR 567
  5610. +#define R_AARCH64_TLSDESC_ADD 568
  5611. +#define R_AARCH64_TLSDESC_CALL 569
  5612. +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
  5613. +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
  5614. +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
  5615. +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
  5616. #define R_AARCH64_COPY 1024
  5617. #define R_AARCH64_GLOB_DAT 1025
  5618. #define R_AARCH64_JUMP_SLOT 1026
  5619. diff -Nur musl-0.9.15/include/fcntl.h musl-git/include/fcntl.h
  5620. --- musl-0.9.15/include/fcntl.h 2014-01-03 21:12:17.000000000 +0100
  5621. +++ musl-git/include/fcntl.h 2014-03-19 07:42:48.000000000 +0100
  5622. @@ -148,6 +148,7 @@
  5623. #define SPLICE_F_MORE 4
  5624. #define SPLICE_F_GIFT 8
  5625. int fallocate(int, int, off_t, off_t);
  5626. +#define fallocate64 fallocate
  5627. ssize_t readahead(int, off_t, size_t);
  5628. int sync_file_range(int, off_t, off_t, unsigned);
  5629. ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
  5630. @@ -160,6 +161,7 @@
  5631. #define F_GETLK64 F_GETLK
  5632. #define F_SETLK64 F_SETLK
  5633. #define F_SETLKW64 F_SETLKW
  5634. +#define flock64 flock
  5635. #define open64 open
  5636. #define openat64 openat
  5637. #define creat64 creat
  5638. diff -Nur musl-0.9.15/include/math.h musl-git/include/math.h
  5639. --- musl-0.9.15/include/math.h 2014-01-03 21:12:17.000000000 +0100
  5640. +++ musl-git/include/math.h 2014-03-19 07:42:48.000000000 +0100
  5641. @@ -42,12 +42,14 @@
  5642. static __inline unsigned __FLOAT_BITS(float __f)
  5643. {
  5644. - union {float __f; unsigned __i;} __u = {__f};
  5645. + union {float __f; unsigned __i;} __u;
  5646. + __u.__f = __f;
  5647. return __u.__i;
  5648. }
  5649. static __inline unsigned long long __DOUBLE_BITS(double __f)
  5650. {
  5651. - union {double __f; unsigned long long __i;} __u = {__f};
  5652. + union {double __f; unsigned long long __i;} __u;
  5653. + __u.__f = __f;
  5654. return __u.__i;
  5655. }
  5656. diff -Nur musl-0.9.15/include/netdb.h musl-git/include/netdb.h
  5657. --- musl-0.9.15/include/netdb.h 2014-01-03 21:12:17.000000000 +0100
  5658. +++ musl-git/include/netdb.h 2014-03-19 07:42:48.000000000 +0100
  5659. @@ -131,6 +131,7 @@
  5660. #define TRY_AGAIN 2
  5661. #define NO_RECOVERY 3
  5662. #define NO_DATA 4
  5663. +#define NO_ADDRESS NO_DATA
  5664. #endif
  5665. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5666. diff -Nur musl-0.9.15/include/netinet/if_ether.h musl-git/include/netinet/if_ether.h
  5667. --- musl-0.9.15/include/netinet/if_ether.h 2014-01-03 21:12:17.000000000 +0100
  5668. +++ musl-git/include/netinet/if_ether.h 2014-03-19 07:42:48.000000000 +0100
  5669. @@ -54,6 +54,7 @@
  5670. #define ETH_P_8021AH 0x88E7
  5671. #define ETH_P_MVRP 0x88F5
  5672. #define ETH_P_1588 0x88F7
  5673. +#define ETH_P_PRP 0x88FB
  5674. #define ETH_P_FCOE 0x8906
  5675. #define ETH_P_TDLS 0x890D
  5676. #define ETH_P_FIP 0x8914
  5677. diff -Nur musl-0.9.15/include/netinet/in.h musl-git/include/netinet/in.h
  5678. --- musl-0.9.15/include/netinet/in.h 2014-01-03 21:12:17.000000000 +0100
  5679. +++ musl-git/include/netinet/in.h 2014-03-19 07:42:48.000000000 +0100
  5680. @@ -149,7 +149,7 @@
  5681. (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe))
  5682. #define __ARE_4_EQUAL(a,b) \
  5683. - (!( 0[a]-0[b] | 1[a]-1[b] | 2[a]-2[b] | 3[a]-3[b] ))
  5684. + (!( (0[a]-0[b]) | (1[a]-1[b]) | (2[a]-2[b]) | (3[a]-3[b]) ))
  5685. #define IN6_ARE_ADDR_EQUAL(a,b) \
  5686. __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b))
  5687. @@ -211,27 +211,13 @@
  5688. #define IP_MULTICAST_ALL 49
  5689. #define IP_UNICAST_IF 50
  5690. -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5691. -#define MCAST_JOIN_GROUP 42
  5692. -#define MCAST_BLOCK_SOURCE 43
  5693. -#define MCAST_UNBLOCK_SOURCE 44
  5694. -#define MCAST_LEAVE_GROUP 45
  5695. -#define MCAST_JOIN_SOURCE_GROUP 46
  5696. -#define MCAST_LEAVE_SOURCE_GROUP 47
  5697. -#define MCAST_MSFILTER 48
  5698. -
  5699. -#define MCAST_EXCLUDE 0
  5700. -#define MCAST_INCLUDE 1
  5701. -#endif
  5702. -
  5703. #define IP_RECVRETOPTS IP_RETOPTS
  5704. #define IP_PMTUDISC_DONT 0
  5705. #define IP_PMTUDISC_WANT 1
  5706. #define IP_PMTUDISC_DO 2
  5707. #define IP_PMTUDISC_PROBE 3
  5708. -
  5709. -#define SOL_IP 0
  5710. +#define IP_PMTUDISC_INTERFACE 4
  5711. #define IP_DEFAULT_MULTICAST_TTL 1
  5712. #define IP_DEFAULT_MULTICAST_LOOP 1
  5713. @@ -243,6 +229,19 @@
  5714. char ip_opts[40];
  5715. };
  5716. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5717. +
  5718. +#define MCAST_JOIN_GROUP 42
  5719. +#define MCAST_BLOCK_SOURCE 43
  5720. +#define MCAST_UNBLOCK_SOURCE 44
  5721. +#define MCAST_LEAVE_GROUP 45
  5722. +#define MCAST_JOIN_SOURCE_GROUP 46
  5723. +#define MCAST_LEAVE_SOURCE_GROUP 47
  5724. +#define MCAST_MSFILTER 48
  5725. +
  5726. +#define MCAST_EXCLUDE 0
  5727. +#define MCAST_INCLUDE 1
  5728. +
  5729. struct ip_mreq
  5730. {
  5731. struct in_addr imr_multiaddr;
  5732. @@ -273,7 +272,6 @@
  5733. (sizeof(struct ip_msfilter) - sizeof(struct in_addr) \
  5734. + (numsrc) * sizeof(struct in_addr))
  5735. -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5736. struct group_req {
  5737. uint32_t gr_interface;
  5738. struct sockaddr_storage gr_group;
  5739. @@ -295,7 +293,6 @@
  5740. #define GROUP_FILTER_SIZE(numsrc) \
  5741. (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \
  5742. + (numsrc) * sizeof(struct sockaddr_storage))
  5743. -#endif
  5744. struct in_pktinfo
  5745. {
  5746. @@ -315,6 +312,7 @@
  5747. struct sockaddr_in6 ip6m_addr;
  5748. uint32_t ip6m_mtu;
  5749. };
  5750. +#endif
  5751. #define IPV6_ADDRFORM 1
  5752. #define IPV6_2292PKTINFO 2
  5753. @@ -324,7 +322,6 @@
  5754. #define IPV6_2292PKTOPTIONS 6
  5755. #define IPV6_CHECKSUM 7
  5756. #define IPV6_2292HOPLIMIT 8
  5757. -#define SCM_SRCRT IPV6_RXSRCRT
  5758. #define IPV6_NEXTHOP 9
  5759. #define IPV6_AUTHHDR 10
  5760. #define IPV6_UNICAST_HOPS 16
  5761. @@ -363,15 +360,11 @@
  5762. #define IPV6_RXHOPOPTS IPV6_HOPOPTS
  5763. #define IPV6_RXDSTOPTS IPV6_DSTOPTS
  5764. -
  5765. #define IPV6_PMTUDISC_DONT 0
  5766. #define IPV6_PMTUDISC_WANT 1
  5767. #define IPV6_PMTUDISC_DO 2
  5768. #define IPV6_PMTUDISC_PROBE 3
  5769. -#define SOL_IPV6 41
  5770. -#define SOL_ICMPV6 58
  5771. -
  5772. #define IPV6_RTHDR_LOOSE 0
  5773. #define IPV6_RTHDR_STRICT 1
  5774. diff -Nur musl-0.9.15/include/netinet/tcp.h musl-git/include/netinet/tcp.h
  5775. --- musl-0.9.15/include/netinet/tcp.h 2014-01-03 21:12:17.000000000 +0100
  5776. +++ musl-git/include/netinet/tcp.h 2014-03-19 07:42:48.000000000 +0100
  5777. @@ -44,42 +44,80 @@
  5778. #define SOL_TCP 6
  5779. #include <sys/types.h>
  5780. #include <sys/socket.h>
  5781. -#endif
  5782. +#include <stdint.h>
  5783. +#include <endian.h>
  5784. +
  5785. +typedef uint32_t tcp_seq;
  5786. +#define TH_FIN 0x01
  5787. +#define TH_SYN 0x02
  5788. +#define TH_RST 0x04
  5789. +#define TH_PUSH 0x08
  5790. +#define TH_ACK 0x10
  5791. +#define TH_URG 0x20
  5792. +
  5793. +struct tcphdr {
  5794. #ifdef _GNU_SOURCE
  5795. -#include <endian.h>
  5796. -struct tcphdr
  5797. -{
  5798. - u_int16_t source;
  5799. - u_int16_t dest;
  5800. - u_int32_t seq;
  5801. - u_int32_t ack_seq;
  5802. +#ifdef __GNUC__
  5803. + __extension__
  5804. +#endif
  5805. + union { struct {
  5806. +
  5807. + uint16_t source;
  5808. + uint16_t dest;
  5809. + uint32_t seq;
  5810. + uint32_t ack_seq;
  5811. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  5812. + uint16_t res1:4;
  5813. + uint16_t doff:4;
  5814. + uint16_t fin:1;
  5815. + uint16_t syn:1;
  5816. + uint16_t rst:1;
  5817. + uint16_t psh:1;
  5818. + uint16_t ack:1;
  5819. + uint16_t urg:1;
  5820. + uint16_t res2:2;
  5821. +#else
  5822. + uint16_t doff:4;
  5823. + uint16_t res1:4;
  5824. + uint16_t res2:2;
  5825. + uint16_t urg:1;
  5826. + uint16_t ack:1;
  5827. + uint16_t psh:1;
  5828. + uint16_t rst:1;
  5829. + uint16_t syn:1;
  5830. + uint16_t fin:1;
  5831. +#endif
  5832. + uint16_t window;
  5833. + uint16_t check;
  5834. + uint16_t urg_ptr;
  5835. +
  5836. + }; struct {
  5837. +#endif
  5838. +
  5839. + uint16_t th_sport;
  5840. + uint16_t th_dport;
  5841. + uint32_t th_seq;
  5842. + uint32_t th_ack;
  5843. #if __BYTE_ORDER == __LITTLE_ENDIAN
  5844. - u_int16_t res1:4;
  5845. - u_int16_t doff:4;
  5846. - u_int16_t fin:1;
  5847. - u_int16_t syn:1;
  5848. - u_int16_t rst:1;
  5849. - u_int16_t psh:1;
  5850. - u_int16_t ack:1;
  5851. - u_int16_t urg:1;
  5852. - u_int16_t res2:2;
  5853. + uint8_t th_x2:4;
  5854. + uint8_t th_off:4;
  5855. #else
  5856. - u_int16_t doff:4;
  5857. - u_int16_t res1:4;
  5858. - u_int16_t res2:2;
  5859. - u_int16_t urg:1;
  5860. - u_int16_t ack:1;
  5861. - u_int16_t psh:1;
  5862. - u_int16_t rst:1;
  5863. - u_int16_t syn:1;
  5864. - u_int16_t fin:1;
  5865. -#endif
  5866. - u_int16_t window;
  5867. - u_int16_t check;
  5868. - u_int16_t urg_ptr;
  5869. + uint8_t th_off:4;
  5870. + uint8_t th_x2:4;
  5871. +#endif
  5872. + uint8_t th_flags;
  5873. + uint16_t th_win;
  5874. + uint16_t th_sum;
  5875. + uint16_t th_urp;
  5876. +
  5877. +#ifdef _GNU_SOURCE
  5878. + }; };
  5879. +#endif
  5880. };
  5881. +#endif
  5882. +#ifdef _GNU_SOURCE
  5883. #define TCPI_OPT_TIMESTAMPS 1
  5884. #define TCPI_OPT_SACK 2
  5885. #define TCPI_OPT_WSCALE 4
  5886. @@ -93,37 +131,37 @@
  5887. struct tcp_info
  5888. {
  5889. - u_int8_t tcpi_state;
  5890. - u_int8_t tcpi_ca_state;
  5891. - u_int8_t tcpi_retransmits;
  5892. - u_int8_t tcpi_probes;
  5893. - u_int8_t tcpi_backoff;
  5894. - u_int8_t tcpi_options;
  5895. - u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
  5896. - u_int32_t tcpi_rto;
  5897. - u_int32_t tcpi_ato;
  5898. - u_int32_t tcpi_snd_mss;
  5899. - u_int32_t tcpi_rcv_mss;
  5900. - u_int32_t tcpi_unacked;
  5901. - u_int32_t tcpi_sacked;
  5902. - u_int32_t tcpi_lost;
  5903. - u_int32_t tcpi_retrans;
  5904. - u_int32_t tcpi_fackets;
  5905. - u_int32_t tcpi_last_data_sent;
  5906. - u_int32_t tcpi_last_ack_sent;
  5907. - u_int32_t tcpi_last_data_recv;
  5908. - u_int32_t tcpi_last_ack_recv;
  5909. - u_int32_t tcpi_pmtu;
  5910. - u_int32_t tcpi_rcv_ssthresh;
  5911. - u_int32_t tcpi_rtt;
  5912. - u_int32_t tcpi_rttvar;
  5913. - u_int32_t tcpi_snd_ssthresh;
  5914. - u_int32_t tcpi_snd_cwnd;
  5915. - u_int32_t tcpi_advmss;
  5916. - u_int32_t tcpi_reordering;
  5917. - u_int32_t tcpi_rcv_rtt;
  5918. - u_int32_t tcpi_rcv_space;
  5919. - u_int32_t tcpi_total_retrans;
  5920. + uint8_t tcpi_state;
  5921. + uint8_t tcpi_ca_state;
  5922. + uint8_t tcpi_retransmits;
  5923. + uint8_t tcpi_probes;
  5924. + uint8_t tcpi_backoff;
  5925. + uint8_t tcpi_options;
  5926. + uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
  5927. + uint32_t tcpi_rto;
  5928. + uint32_t tcpi_ato;
  5929. + uint32_t tcpi_snd_mss;
  5930. + uint32_t tcpi_rcv_mss;
  5931. + uint32_t tcpi_unacked;
  5932. + uint32_t tcpi_sacked;
  5933. + uint32_t tcpi_lost;
  5934. + uint32_t tcpi_retrans;
  5935. + uint32_t tcpi_fackets;
  5936. + uint32_t tcpi_last_data_sent;
  5937. + uint32_t tcpi_last_ack_sent;
  5938. + uint32_t tcpi_last_data_recv;
  5939. + uint32_t tcpi_last_ack_recv;
  5940. + uint32_t tcpi_pmtu;
  5941. + uint32_t tcpi_rcv_ssthresh;
  5942. + uint32_t tcpi_rtt;
  5943. + uint32_t tcpi_rttvar;
  5944. + uint32_t tcpi_snd_ssthresh;
  5945. + uint32_t tcpi_snd_cwnd;
  5946. + uint32_t tcpi_advmss;
  5947. + uint32_t tcpi_reordering;
  5948. + uint32_t tcpi_rcv_rtt;
  5949. + uint32_t tcpi_rcv_space;
  5950. + uint32_t tcpi_total_retrans;
  5951. };
  5952. #define TCP_MD5SIG_MAXKEYLEN 80
  5953. @@ -131,10 +169,10 @@
  5954. struct tcp_md5sig
  5955. {
  5956. struct sockaddr_storage tcpm_addr;
  5957. - u_int16_t __tcpm_pad1;
  5958. - u_int16_t tcpm_keylen;
  5959. - u_int32_t __tcpm_pad2;
  5960. - u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
  5961. + uint16_t __tcpm_pad1;
  5962. + uint16_t tcpm_keylen;
  5963. + uint32_t __tcpm_pad2;
  5964. + uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
  5965. };
  5966. #endif
  5967. diff -Nur musl-0.9.15/include/netinet/udp.h musl-git/include/netinet/udp.h
  5968. --- musl-0.9.15/include/netinet/udp.h 2014-01-03 21:12:17.000000000 +0100
  5969. +++ musl-git/include/netinet/udp.h 2014-03-19 07:42:48.000000000 +0100
  5970. @@ -5,19 +5,22 @@
  5971. extern "C" {
  5972. #endif
  5973. +#include <features.h>
  5974. #include <stdint.h>
  5975. -struct udphdr {
  5976. - uint16_t source;
  5977. - uint16_t dest;
  5978. - uint16_t len;
  5979. - uint16_t check;
  5980. -};
  5981. -
  5982. +#ifdef _GNU_SOURCE
  5983. #define uh_sport source
  5984. #define uh_dport dest
  5985. #define uh_ulen len
  5986. #define uh_sum check
  5987. +#endif
  5988. +
  5989. +struct udphdr {
  5990. + uint16_t uh_sport;
  5991. + uint16_t uh_dport;
  5992. + uint16_t uh_ulen;
  5993. + uint16_t uh_sum;
  5994. +};
  5995. #define UDP_CORK 1
  5996. #define UDP_ENCAP 100
  5997. diff -Nur musl-0.9.15/include/sched.h musl-git/include/sched.h
  5998. --- musl-0.9.15/include/sched.h 2014-01-03 21:12:17.000000000 +0100
  5999. +++ musl-git/include/sched.h 2014-03-19 07:42:48.000000000 +0100
  6000. @@ -78,7 +78,7 @@
  6001. int sched_getaffinity(pid_t, size_t, cpu_set_t *);
  6002. int sched_setaffinity(pid_t, size_t, const cpu_set_t *);
  6003. -#define __CPU_op_S(i, size, set, op) ( (i)/8 >= (size) ? 0 : \
  6004. +#define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \
  6005. ((set)->__bits[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) )
  6006. #define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=)
  6007. diff -Nur musl-0.9.15/include/signal.h musl-git/include/signal.h
  6008. --- musl-0.9.15/include/signal.h 2014-01-03 21:12:17.000000000 +0100
  6009. +++ musl-git/include/signal.h 2014-03-19 07:42:48.000000000 +0100
  6010. @@ -77,11 +77,7 @@
  6011. #define CLD_STOPPED 5
  6012. #define CLD_CONTINUED 6
  6013. -typedef struct sigaltstack {
  6014. - void *ss_sp;
  6015. - int ss_flags;
  6016. - size_t ss_size;
  6017. -} stack_t;
  6018. +typedef struct sigaltstack stack_t;
  6019. union sigval {
  6020. int sival_int;
  6021. @@ -227,8 +223,8 @@
  6022. typedef void (*sighandler_t)(int);
  6023. void (*bsd_signal(int, void (*)(int)))(int);
  6024. int sigisemptyset(const sigset_t *);
  6025. -int sigorset (sigset_t *, sigset_t *, sigset_t *);
  6026. -int sigandset(sigset_t *, sigset_t *, sigset_t *);
  6027. +int sigorset (sigset_t *, const sigset_t *, const sigset_t *);
  6028. +int sigandset(sigset_t *, const sigset_t *, const sigset_t *);
  6029. #define SA_NOMASK SA_NODEFER
  6030. #define SA_ONESHOT SA_RESETHAND
  6031. diff -Nur musl-0.9.15/include/stdlib.h musl-git/include/stdlib.h
  6032. --- musl-0.9.15/include/stdlib.h 2014-01-03 21:12:17.000000000 +0100
  6033. +++ musl-git/include/stdlib.h 2014-03-19 07:42:48.000000000 +0100
  6034. @@ -93,7 +93,7 @@
  6035. #define WSTOPSIG(s) WEXITSTATUS(s)
  6036. #define WIFEXITED(s) (!WTERMSIG(s))
  6037. #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
  6038. -#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
  6039. +#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
  6040. int posix_memalign (void **, size_t, size_t);
  6041. int setenv (const char *, const char *, int);
  6042. diff -Nur musl-0.9.15/include/sys/inotify.h musl-git/include/sys/inotify.h
  6043. --- musl-0.9.15/include/sys/inotify.h 2014-01-03 21:12:17.000000000 +0100
  6044. +++ musl-git/include/sys/inotify.h 2014-03-19 07:42:48.000000000 +0100
  6045. @@ -48,7 +48,7 @@
  6046. int inotify_init(void);
  6047. int inotify_init1(int);
  6048. int inotify_add_watch(int, const char *, uint32_t);
  6049. -int inotify_rm_watch(int, uint32_t);
  6050. +int inotify_rm_watch(int, int);
  6051. #ifdef __cplusplus
  6052. }
  6053. diff -Nur musl-0.9.15/include/sys/mman.h musl-git/include/sys/mman.h
  6054. --- musl-0.9.15/include/sys/mman.h 2014-01-03 21:12:17.000000000 +0100
  6055. +++ musl-git/include/sys/mman.h 2014-03-19 07:42:48.000000000 +0100
  6056. @@ -33,7 +33,7 @@
  6057. #ifdef _GNU_SOURCE
  6058. void *mremap (void *, size_t, size_t, int, ...);
  6059. -int remap_file_pages (void *, size_t, int, ssize_t, int);
  6060. +int remap_file_pages (void *, size_t, int, size_t, int);
  6061. #endif
  6062. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  6063. diff -Nur musl-0.9.15/include/sys/procfs.h musl-git/include/sys/procfs.h
  6064. --- musl-0.9.15/include/sys/procfs.h 2014-01-03 21:12:17.000000000 +0100
  6065. +++ musl-git/include/sys/procfs.h 2014-03-19 07:42:48.000000000 +0100
  6066. @@ -40,7 +40,7 @@
  6067. char pr_zomb;
  6068. char pr_nice;
  6069. unsigned long int pr_flag;
  6070. -#if __WORDSIZE == 32
  6071. +#if UINTPTR_MAX == 0xffffffff
  6072. unsigned short int pr_uid;
  6073. unsigned short int pr_gid;
  6074. #else
  6075. diff -Nur musl-0.9.15/include/sys/sem.h musl-git/include/sys/sem.h
  6076. --- musl-0.9.15/include/sys/sem.h 2014-01-03 21:12:17.000000000 +0100
  6077. +++ musl-git/include/sys/sem.h 2014-03-19 07:42:48.000000000 +0100
  6078. @@ -27,22 +27,7 @@
  6079. #include <endian.h>
  6080. -struct semid_ds {
  6081. - struct ipc_perm sem_perm;
  6082. - long sem_otime;
  6083. - unsigned long __unused1;
  6084. - long sem_ctime;
  6085. - unsigned long __unused2;
  6086. -#if __BYTE_ORDER == __LITTLE_ENDIAN
  6087. - unsigned short sem_nsems;
  6088. - char __sem_nsems_pad[sizeof(long)-sizeof(short)];
  6089. -#else
  6090. - char __sem_nsems_pad[sizeof(long)-sizeof(short)];
  6091. - unsigned short sem_nsems;
  6092. -#endif
  6093. - unsigned long __unused3;
  6094. - unsigned long __unused4;
  6095. -};
  6096. +#include <bits/sem.h>
  6097. #define _SEM_SEMUN_UNDEFINED 1
  6098. diff -Nur musl-0.9.15/include/sys/shm.h musl-git/include/sys/shm.h
  6099. --- musl-0.9.15/include/sys/shm.h 2014-01-03 21:12:17.000000000 +0100
  6100. +++ musl-git/include/sys/shm.h 2014-03-19 07:42:48.000000000 +0100
  6101. @@ -14,6 +14,13 @@
  6102. #include <bits/alltypes.h>
  6103. #include <sys/ipc.h>
  6104. +
  6105. +#ifdef _GNU_SOURCE
  6106. +#define __used_ids used_ids
  6107. +#define __swap_attempts swap_attempts
  6108. +#define __swap_successes swap_successes
  6109. +#endif
  6110. +
  6111. #include <bits/shm.h>
  6112. #define SHM_R 0400
  6113. @@ -33,20 +40,6 @@
  6114. #define SHM_HUGETLB 04000
  6115. #define SHM_NORESERVE 010000
  6116. -struct shminfo {
  6117. - unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  6118. -};
  6119. -
  6120. -struct shm_info {
  6121. - int used_ids;
  6122. - unsigned long shm_tot, shm_rss, shm_swp;
  6123. -#ifdef _GNU_SOURCE
  6124. - unsigned long swap_attempts, swap_successes;
  6125. -#else
  6126. - unsigned long __reserved[2];
  6127. -#endif
  6128. -};
  6129. -
  6130. typedef unsigned long shmatt_t;
  6131. void *shmat(int, const void *, int);
  6132. diff -Nur musl-0.9.15/include/sys/socket.h musl-git/include/sys/socket.h
  6133. --- musl-0.9.15/include/sys/socket.h 2014-01-03 21:12:17.000000000 +0100
  6134. +++ musl-git/include/sys/socket.h 2014-03-19 07:42:48.000000000 +0100
  6135. @@ -202,11 +202,16 @@
  6136. #define SO_LOCK_FILTER 44
  6137. #define SO_SELECT_ERR_QUEUE 45
  6138. #define SO_BUSY_POLL 46
  6139. +#define SO_MAX_PACING_RATE 47
  6140. #ifndef SOL_SOCKET
  6141. #define SOL_SOCKET 1
  6142. #endif
  6143. +#define SOL_IP 0
  6144. +#define SOL_IPV6 41
  6145. +#define SOL_ICMPV6 58
  6146. +
  6147. #define SOL_RAW 255
  6148. #define SOL_DECNET 261
  6149. #define SOL_X25 262
  6150. diff -Nur musl-0.9.15/include/sys/sysctl.h musl-git/include/sys/sysctl.h
  6151. --- musl-0.9.15/include/sys/sysctl.h 2014-01-03 21:12:17.000000000 +0100
  6152. +++ musl-git/include/sys/sysctl.h 1970-01-01 01:00:00.000000000 +0100
  6153. @@ -1,17 +0,0 @@
  6154. -#ifndef _SYS_SYSCTL_H
  6155. -#define _SYS_SYSCTL_H
  6156. -
  6157. -#ifdef __cplusplus
  6158. -extern "C" {
  6159. -#endif
  6160. -
  6161. -#define __NEED_size_t
  6162. -#include <bits/alltypes.h>
  6163. -
  6164. -int sysctl (int *, int, void *, size_t *, void *, size_t);
  6165. -
  6166. -#ifdef __cplusplus
  6167. -}
  6168. -#endif
  6169. -
  6170. -#endif
  6171. diff -Nur musl-0.9.15/include/sys/time.h musl-git/include/sys/time.h
  6172. --- musl-0.9.15/include/sys/time.h 2014-01-03 21:12:17.000000000 +0100
  6173. +++ musl-git/include/sys/time.h 2014-03-19 07:42:48.000000000 +0100
  6174. @@ -51,6 +51,17 @@
  6175. ((a)->tv_usec += 1000000, (a)->tv_sec--) )
  6176. #endif
  6177. +#if defined(_GNU_SOURCE)
  6178. +#define TIMEVAL_TO_TIMESPEC(tv, ts) ( \
  6179. + (ts)->tv_sec = (tv)->tv_sec, \
  6180. + (ts)->tv_nsec = (tv)->tv_usec * 1000, \
  6181. + (void)0 )
  6182. +#define TIMESPEC_TO_TIMEVAL(tv, ts) ( \
  6183. + (tv)->tv_sec = (ts)->tv_sec, \
  6184. + (tv)->tv_usec = (ts)->tv_nsec / 1000, \
  6185. + (void)0 )
  6186. +#endif
  6187. +
  6188. #ifdef __cplusplus
  6189. }
  6190. #endif
  6191. diff -Nur musl-0.9.15/include/sys/wait.h musl-git/include/sys/wait.h
  6192. --- musl-0.9.15/include/sys/wait.h 2014-01-03 21:12:17.000000000 +0100
  6193. +++ musl-git/include/sys/wait.h 2014-03-19 07:42:48.000000000 +0100
  6194. @@ -50,7 +50,7 @@
  6195. #define WCOREDUMP(s) ((s) & 0x80)
  6196. #define WIFEXITED(s) (!WTERMSIG(s))
  6197. #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
  6198. -#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
  6199. +#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
  6200. #define WIFCONTINUED(s) ((s) == 0xffff)
  6201. #ifdef __cplusplus
  6202. diff -Nur musl-0.9.15/include/syslog.h musl-git/include/syslog.h
  6203. --- musl-0.9.15/include/syslog.h 2014-01-03 21:12:17.000000000 +0100
  6204. +++ musl-git/include/syslog.h 2014-03-19 07:42:48.000000000 +0100
  6205. @@ -21,7 +21,7 @@
  6206. #define LOG_MAKEPRI(f, p) (((f)<<3)|(p))
  6207. #define LOG_MASK(p) (1<<(p))
  6208. -#define LOG_UPTO(p) ((1<<(p)+1)-1)
  6209. +#define LOG_UPTO(p) ((1<<((p)+1))-1)
  6210. #define LOG_KERN (0<<3)
  6211. #define LOG_USER (1<<3)
  6212. diff -Nur musl-0.9.15/include/time.h musl-git/include/time.h
  6213. --- musl-0.9.15/include/time.h 2014-01-03 21:12:17.000000000 +0100
  6214. +++ musl-git/include/time.h 2014-03-19 07:42:48.000000000 +0100
  6215. @@ -125,7 +125,7 @@
  6216. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  6217. -int stime(time_t *);
  6218. +int stime(const time_t *);
  6219. time_t timegm(struct tm *);
  6220. #endif
  6221. diff -Nur musl-0.9.15/include/utmp.h musl-git/include/utmp.h
  6222. --- musl-0.9.15/include/utmp.h 2014-01-03 21:12:17.000000000 +0100
  6223. +++ musl-git/include/utmp.h 2014-03-19 07:42:48.000000000 +0100
  6224. @@ -10,6 +10,7 @@
  6225. #define ACCOUNTING 9
  6226. #define UT_NAMESIZE 32
  6227. #define UT_HOSTSIZE 256
  6228. +#define UT_LINESIZE 32
  6229. struct lastlog {
  6230. time_t ll_time;
  6231. @@ -22,6 +23,8 @@
  6232. #define ut_addr ut_addr_v6[0]
  6233. #define utmp utmpx
  6234. #define utmpname(x) (-1)
  6235. +#define e_exit __e_exit
  6236. +#define e_termination __e_termination
  6237. void endutent(void);
  6238. struct utmp *getutent(void);
  6239. diff -Nur musl-0.9.15/include/utmpx.h musl-git/include/utmpx.h
  6240. --- musl-0.9.15/include/utmpx.h 2014-01-03 21:12:17.000000000 +0100
  6241. +++ musl-git/include/utmpx.h 2014-03-19 07:42:48.000000000 +0100
  6242. @@ -5,6 +5,8 @@
  6243. extern "C" {
  6244. #endif
  6245. +#include <features.h>
  6246. +
  6247. #define __NEED_pid_t
  6248. #define __NEED_time_t
  6249. #define __NEED_suseconds_t
  6250. @@ -12,19 +14,17 @@
  6251. #include <bits/alltypes.h>
  6252. -#define UT_LINESIZE 32
  6253. -
  6254. struct utmpx
  6255. {
  6256. short ut_type;
  6257. pid_t ut_pid;
  6258. - char ut_line[UT_LINESIZE];
  6259. + char ut_line[32];
  6260. char ut_id[4];
  6261. char ut_user[32];
  6262. char ut_host[256];
  6263. struct {
  6264. - short e_termination;
  6265. - short e_exit;
  6266. + short __e_termination;
  6267. + short __e_exit;
  6268. } ut_exit;
  6269. long ut_session;
  6270. struct timeval ut_tv;
  6271. @@ -39,7 +39,11 @@
  6272. struct utmpx *pututxline(const struct utmpx *);
  6273. void setutxent(void);
  6274. +#if defined(_BSD_SOURCE) | defined(_GNU_SOURCE)
  6275. +#define e_exit __e_exit
  6276. +#define e_termination __e_termination
  6277. void updwtmpx(const char *, const struct utmpx *);
  6278. +#endif
  6279. #define EMPTY 0
  6280. #define RUN_LVL 1
  6281. diff -Nur musl-0.9.15/src/crypt/crypt_des.c musl-git/src/crypt/crypt_des.c
  6282. --- musl-0.9.15/src/crypt/crypt_des.c 2014-01-03 21:12:17.000000000 +0100
  6283. +++ musl-git/src/crypt/crypt_des.c 2014-03-19 07:42:48.000000000 +0100
  6284. @@ -692,7 +692,7 @@
  6285. return saltbits;
  6286. }
  6287. -static void des_setkey(const unsigned char *key, struct expanded_key *ekey)
  6288. +void __des_setkey(const unsigned char *key, struct expanded_key *ekey)
  6289. {
  6290. uint32_t k0, k1, rawkey0, rawkey1;
  6291. unsigned int shifts, round, i, ibit;
  6292. @@ -753,7 +753,7 @@
  6293. /*
  6294. * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
  6295. */
  6296. -static void do_des(uint32_t l_in, uint32_t r_in,
  6297. +void __do_des(uint32_t l_in, uint32_t r_in,
  6298. uint32_t *l_out, uint32_t *r_out,
  6299. uint32_t count, uint32_t saltbits, const struct expanded_key *ekey)
  6300. {
  6301. @@ -862,7 +862,7 @@
  6302. ((uint32_t)in[5] << 16) |
  6303. ((uint32_t)in[4] << 24);
  6304. - do_des(rawl, rawr, &l_out, &r_out, count, saltbits, ekey);
  6305. + __do_des(rawl, rawr, &l_out, &r_out, count, saltbits, ekey);
  6306. out[0] = l_out >> 24;
  6307. out[1] = l_out >> 16;
  6308. @@ -894,7 +894,7 @@
  6309. if (*key)
  6310. key++;
  6311. }
  6312. - des_setkey(keybuf, &ekey);
  6313. + __des_setkey(keybuf, &ekey);
  6314. if (*setting == _PASSWORD_EFMT1) {
  6315. /*
  6316. @@ -929,7 +929,7 @@
  6317. q = keybuf;
  6318. while (q <= &keybuf[sizeof(keybuf) - 1] && *key)
  6319. *q++ ^= *key++ << 1;
  6320. - des_setkey(keybuf, &ekey);
  6321. + __des_setkey(keybuf, &ekey);
  6322. }
  6323. memcpy(output, setting, 9);
  6324. @@ -957,7 +957,7 @@
  6325. /*
  6326. * Do it.
  6327. */
  6328. - do_des(0, 0, &r0, &r1, count, setup_salt(salt), &ekey);
  6329. + __do_des(0, 0, &r0, &r1, count, setup_salt(salt), &ekey);
  6330. /*
  6331. * Now encode the result...
  6332. diff -Nur musl-0.9.15/src/crypt/encrypt.c musl-git/src/crypt/encrypt.c
  6333. --- musl-0.9.15/src/crypt/encrypt.c 1970-01-01 01:00:00.000000000 +0100
  6334. +++ musl-git/src/crypt/encrypt.c 2014-03-19 07:42:48.000000000 +0100
  6335. @@ -0,0 +1,60 @@
  6336. +#include <stdint.h>
  6337. +#include <stdlib.h>
  6338. +#include <unistd.h>
  6339. +
  6340. +struct expanded_key {
  6341. + uint32_t l[16], r[16];
  6342. +};
  6343. +
  6344. +void __des_setkey(const unsigned char *key, struct expanded_key *ekey);
  6345. +void __do_des(uint32_t l_in, uint32_t r_in,
  6346. + uint32_t *l_out, uint32_t *r_out,
  6347. + uint32_t count, uint32_t saltbits, const struct expanded_key *ekey);
  6348. +
  6349. +
  6350. +static struct expanded_key __encrypt_key;
  6351. +
  6352. +void setkey(const char *key)
  6353. +{
  6354. + unsigned char bkey[8];
  6355. + int i, j;
  6356. +
  6357. + for (i = 0; i < 8; i++) {
  6358. + bkey[i] = 0;
  6359. + for (j = 7; j >= 0; j--, key++)
  6360. + bkey[i] |= (uint32_t)(*key & 1) << j;
  6361. + }
  6362. +
  6363. + __des_setkey(bkey, &__encrypt_key);
  6364. +}
  6365. +
  6366. +void encrypt(char *block, int edflag)
  6367. +{
  6368. + struct expanded_key decrypt_key, *key;
  6369. + uint32_t b[2];
  6370. + int i, j;
  6371. + char *p;
  6372. +
  6373. + p = block;
  6374. + for (i = 0; i < 2; i++) {
  6375. + b[i] = 0;
  6376. + for (j = 31; j >= 0; j--, p++)
  6377. + b[i] |= (uint32_t)(*p & 1) << j;
  6378. + }
  6379. +
  6380. + key = &__encrypt_key;
  6381. + if (edflag) {
  6382. + key = &decrypt_key;
  6383. + for (i = 0; i < 16; i++) {
  6384. + decrypt_key.l[i] = __encrypt_key.l[15-i];
  6385. + decrypt_key.r[i] = __encrypt_key.r[15-i];
  6386. + }
  6387. + }
  6388. +
  6389. + __do_des(b[0], b[1], b, b + 1, 1, 0, key);
  6390. +
  6391. + p = block;
  6392. + for (i = 0; i < 2; i++)
  6393. + for (j = 31; j >= 0; j--)
  6394. + *p++ = b[i]>>j & 1;
  6395. +}
  6396. diff -Nur musl-0.9.15/src/dirent/readdir.c musl-git/src/dirent/readdir.c
  6397. --- musl-0.9.15/src/dirent/readdir.c 2014-01-03 21:12:17.000000000 +0100
  6398. +++ musl-git/src/dirent/readdir.c 2014-03-19 07:42:48.000000000 +0100
  6399. @@ -1,5 +1,7 @@
  6400. #include <dirent.h>
  6401. +#include <errno.h>
  6402. #include "__dirent.h"
  6403. +#include "syscall.h"
  6404. #include "libc.h"
  6405. int __getdents(int, struct dirent *, size_t);
  6406. @@ -9,8 +11,11 @@
  6407. struct dirent *de;
  6408. if (dir->buf_pos >= dir->buf_end) {
  6409. - int len = __getdents(dir->fd, (void *)dir->buf, sizeof dir->buf);
  6410. - if (len <= 0) return 0;
  6411. + int len = __syscall(SYS_getdents, dir->fd, dir->buf, sizeof dir->buf);
  6412. + if (len <= 0) {
  6413. + if (len < 0 && len != -ENOENT) errno = -len;
  6414. + return 0;
  6415. + }
  6416. dir->buf_end = len;
  6417. dir->buf_pos = 0;
  6418. }
  6419. diff -Nur musl-0.9.15/src/errno/strerror.c musl-git/src/errno/strerror.c
  6420. --- musl-0.9.15/src/errno/strerror.c 2014-01-03 21:12:17.000000000 +0100
  6421. +++ musl-git/src/errno/strerror.c 2014-03-19 07:42:48.000000000 +0100
  6422. @@ -1,7 +1,7 @@
  6423. #include <errno.h>
  6424. #include <string.h>
  6425. -#define E(a,b) a,
  6426. +#define E(a,b) ((unsigned char)a),
  6427. static const unsigned char errid[] = {
  6428. #include "__strerror.h"
  6429. };
  6430. @@ -16,6 +16,12 @@
  6431. {
  6432. const char *s;
  6433. int i;
  6434. + /* mips has one error code outside of the 8-bit range due to a
  6435. + * historical typo, so we just remap it. */
  6436. + if (EDQUOT==1133) {
  6437. + if (e==109) e=-1;
  6438. + else if (e==EDQUOT) e=109;
  6439. + }
  6440. for (i=0; errid[i] && errid[i] != e; i++);
  6441. for (s=errmsg; i; s++, i--) for (; *s; s++);
  6442. return (char *)s;
  6443. diff -Nur musl-0.9.15/src/fcntl/fcntl.c musl-git/src/fcntl/fcntl.c
  6444. --- musl-0.9.15/src/fcntl/fcntl.c 2014-01-03 21:12:17.000000000 +0100
  6445. +++ musl-git/src/fcntl/fcntl.c 2014-03-19 07:42:48.000000000 +0100
  6446. @@ -7,17 +7,17 @@
  6447. int fcntl(int fd, int cmd, ...)
  6448. {
  6449. - long arg;
  6450. + unsigned long arg;
  6451. va_list ap;
  6452. va_start(ap, cmd);
  6453. - arg = va_arg(ap, long);
  6454. + arg = va_arg(ap, unsigned long);
  6455. va_end(ap);
  6456. if (cmd == F_SETFL) arg |= O_LARGEFILE;
  6457. - if (cmd == F_SETLKW) return syscall_cp(SYS_fcntl, fd, cmd, arg);
  6458. + if (cmd == F_SETLKW) return syscall_cp(SYS_fcntl, fd, cmd, (void *)arg);
  6459. if (cmd == F_GETOWN) {
  6460. struct f_owner_ex ex;
  6461. int ret = __syscall(SYS_fcntl, fd, F_GETOWN_EX, &ex);
  6462. - if (ret == -EINVAL) return __syscall(SYS_fcntl, fd, cmd, arg);
  6463. + if (ret == -EINVAL) return __syscall(SYS_fcntl, fd, cmd, (void *)arg);
  6464. if (ret) return __syscall_ret(ret);
  6465. return ex.type == F_OWNER_PGRP ? -ex.pid : ex.pid;
  6466. }
  6467. @@ -37,5 +37,14 @@
  6468. if (ret >= 0) __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
  6469. return __syscall_ret(ret);
  6470. }
  6471. - return syscall(SYS_fcntl, fd, cmd, arg);
  6472. + switch (cmd) {
  6473. + case F_SETLK:
  6474. + case F_SETLKW:
  6475. + case F_GETLK:
  6476. + case F_GETOWN_EX:
  6477. + case F_SETOWN_EX:
  6478. + return syscall(SYS_fcntl, fd, cmd, (void *)arg);
  6479. + default:
  6480. + return syscall(SYS_fcntl, fd, cmd, arg);
  6481. + }
  6482. }
  6483. diff -Nur musl-0.9.15/src/fcntl/posix_fadvise.c musl-git/src/fcntl/posix_fadvise.c
  6484. --- musl-0.9.15/src/fcntl/posix_fadvise.c 2014-01-03 21:12:17.000000000 +0100
  6485. +++ musl-git/src/fcntl/posix_fadvise.c 2014-03-19 07:42:48.000000000 +0100
  6486. @@ -1,8 +1,11 @@
  6487. #include <fcntl.h>
  6488. #include "syscall.h"
  6489. +#include "libc.h"
  6490. int posix_fadvise(int fd, off_t base, off_t len, int advice)
  6491. {
  6492. return -(__syscall)(SYS_fadvise, fd, __SYSCALL_LL_O(base),
  6493. __SYSCALL_LL_E(len), advice);
  6494. }
  6495. +
  6496. +LFS64(posix_fadvise);
  6497. diff -Nur musl-0.9.15/src/fcntl/posix_fallocate.c musl-git/src/fcntl/posix_fallocate.c
  6498. --- musl-0.9.15/src/fcntl/posix_fallocate.c 2014-01-03 21:12:17.000000000 +0100
  6499. +++ musl-git/src/fcntl/posix_fallocate.c 2014-03-19 07:42:48.000000000 +0100
  6500. @@ -1,8 +1,11 @@
  6501. #include <fcntl.h>
  6502. #include "syscall.h"
  6503. +#include "libc.h"
  6504. int posix_fallocate(int fd, off_t base, off_t len)
  6505. {
  6506. return -__syscall(SYS_fallocate, fd, 0, __SYSCALL_LL_E(base),
  6507. __SYSCALL_LL_E(len));
  6508. }
  6509. +
  6510. +LFS64(posix_fallocate);
  6511. diff -Nur musl-0.9.15/src/fenv/i386/fenv.s musl-git/src/fenv/i386/fenv.s
  6512. --- musl-0.9.15/src/fenv/i386/fenv.s 2014-01-03 21:12:17.000000000 +0100
  6513. +++ musl-git/src/fenv/i386/fenv.s 2014-03-19 07:42:48.000000000 +0100
  6514. @@ -126,7 +126,7 @@
  6515. push %eax
  6516. push %eax
  6517. push %eax
  6518. - push %eax
  6519. + pushl $0xffff
  6520. push %eax
  6521. pushl $0x37f
  6522. fldenv (%esp)
  6523. diff -Nur musl-0.9.15/src/fenv/mipsel-sf/fenv.sub musl-git/src/fenv/mipsel-sf/fenv.sub
  6524. --- musl-0.9.15/src/fenv/mipsel-sf/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  6525. +++ musl-git/src/fenv/mipsel-sf/fenv.sub 2014-03-19 07:42:48.000000000 +0100
  6526. @@ -0,0 +1 @@
  6527. +../fenv.c
  6528. diff -Nur musl-0.9.15/src/fenv/mips-sf/fenv.sub musl-git/src/fenv/mips-sf/fenv.sub
  6529. --- musl-0.9.15/src/fenv/mips-sf/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  6530. +++ musl-git/src/fenv/mips-sf/fenv.sub 2014-03-19 07:42:48.000000000 +0100
  6531. @@ -0,0 +1 @@
  6532. +../fenv.c
  6533. diff -Nur musl-0.9.15/src/fenv/sh/fenv.s musl-git/src/fenv/sh/fenv.s
  6534. --- musl-0.9.15/src/fenv/sh/fenv.s 1970-01-01 01:00:00.000000000 +0100
  6535. +++ musl-git/src/fenv/sh/fenv.s 2014-03-19 07:42:48.000000000 +0100
  6536. @@ -0,0 +1,74 @@
  6537. +.global fegetround
  6538. +.type fegetround, @function
  6539. +fegetround:
  6540. + sts fpscr, r0
  6541. + rts
  6542. + and #3, r0
  6543. +
  6544. +.global __fesetround
  6545. +.type __fesetround, @function
  6546. +__fesetround:
  6547. + sts fpscr, r0
  6548. + or r4, r0
  6549. + lds r0, fpscr
  6550. + rts
  6551. + mov #0, r0
  6552. +
  6553. +.global fetestexcept
  6554. +.type fetestexcept, @function
  6555. +fetestexcept:
  6556. + sts fpscr, r0
  6557. + and r4, r0
  6558. + rts
  6559. + and #0x7c, r0
  6560. +
  6561. +.global feclearexcept
  6562. +.type feclearexcept, @function
  6563. +feclearexcept:
  6564. + mov r4, r0
  6565. + and #0x7c, r0
  6566. + not r0, r4
  6567. + sts fpscr, r0
  6568. + and r4, r0
  6569. + lds r0, fpscr
  6570. + rts
  6571. + mov #0, r0
  6572. +
  6573. +.global feraiseexcept
  6574. +.type feraiseexcept, @function
  6575. +feraiseexcept:
  6576. + mov r4, r0
  6577. + and #0x7c, r0
  6578. + sts fpscr, r4
  6579. + or r4, r0
  6580. + lds r0, fpscr
  6581. + rts
  6582. + mov #0, r0
  6583. +
  6584. +.global fegetenv
  6585. +.type fegetenv, @function
  6586. +fegetenv:
  6587. + sts fpscr, r0
  6588. + mov.l r0, @r4
  6589. + rts
  6590. + mov #0, r0
  6591. +
  6592. +.global fesetenv
  6593. +.type fesetenv, @function
  6594. +fesetenv:
  6595. + mov r4, r0
  6596. + cmp/eq #-1, r0
  6597. + bf 1f
  6598. +
  6599. + ! the default environment is complicated by the fact that we need to
  6600. + ! preserve the current precision bit, which we do not know a priori
  6601. + sts fpscr, r0
  6602. + mov #8, r1
  6603. + swap.w r1, r1
  6604. + bra 2f
  6605. + and r1, r0
  6606. +
  6607. +1: mov.l @r4, r0 ! non-default environment
  6608. +2: lds r0, fpscr
  6609. + rts
  6610. + mov #0, r0
  6611. diff -Nur musl-0.9.15/src/fenv/sheb-nofpu/fenv.sub musl-git/src/fenv/sheb-nofpu/fenv.sub
  6612. --- musl-0.9.15/src/fenv/sheb-nofpu/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  6613. +++ musl-git/src/fenv/sheb-nofpu/fenv.sub 2014-03-19 07:42:48.000000000 +0100
  6614. @@ -0,0 +1 @@
  6615. +../fenv.c
  6616. diff -Nur musl-0.9.15/src/fenv/sh-nofpu/fenv.sub musl-git/src/fenv/sh-nofpu/fenv.sub
  6617. --- musl-0.9.15/src/fenv/sh-nofpu/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  6618. +++ musl-git/src/fenv/sh-nofpu/fenv.sub 2014-03-19 07:42:48.000000000 +0100
  6619. @@ -0,0 +1 @@
  6620. +../fenv.c
  6621. diff -Nur musl-0.9.15/src/fenv/x32/fenv.s musl-git/src/fenv/x32/fenv.s
  6622. --- musl-0.9.15/src/fenv/x32/fenv.s 1970-01-01 01:00:00.000000000 +0100
  6623. +++ musl-git/src/fenv/x32/fenv.s 2014-03-19 07:42:48.000000000 +0100
  6624. @@ -0,0 +1,97 @@
  6625. +.global feclearexcept
  6626. +.type feclearexcept,@function
  6627. +feclearexcept:
  6628. + # maintain exceptions in the sse mxcsr, clear x87 exceptions
  6629. + mov %edi,%ecx
  6630. + and $0x3f,%ecx
  6631. + fnstsw %ax
  6632. + test %eax,%ecx
  6633. + jz 1f
  6634. + fnclex
  6635. +1: stmxcsr -8(%esp)
  6636. + and $0x3f,%eax
  6637. + or %eax,-8(%esp)
  6638. + test %ecx,-8(%esp)
  6639. + jz 1f
  6640. + not %ecx
  6641. + and %ecx,-8(%esp)
  6642. + ldmxcsr -8(%esp)
  6643. +1: xor %eax,%eax
  6644. + ret
  6645. +
  6646. +.global feraiseexcept
  6647. +.type feraiseexcept,@function
  6648. +feraiseexcept:
  6649. + and $0x3f,%edi
  6650. + stmxcsr -8(%esp)
  6651. + or %edi,-8(%esp)
  6652. + ldmxcsr -8(%esp)
  6653. + xor %eax,%eax
  6654. + ret
  6655. +
  6656. +.global __fesetround
  6657. +.type __fesetround,@function
  6658. +__fesetround:
  6659. + push %rax
  6660. + xor %eax,%eax
  6661. + mov %edi,%ecx
  6662. + fnstcw (%esp)
  6663. + andb $0xf3,1(%esp)
  6664. + or %ch,1(%esp)
  6665. + fldcw (%esp)
  6666. + stmxcsr (%esp)
  6667. + shl $3,%ch
  6668. + andb $0x9f,1(%esp)
  6669. + or %ch,1(%esp)
  6670. + ldmxcsr (%esp)
  6671. + pop %rcx
  6672. + ret
  6673. +
  6674. +.global fegetround
  6675. +.type fegetround,@function
  6676. +fegetround:
  6677. + push %rax
  6678. + stmxcsr (%esp)
  6679. + pop %rax
  6680. + shr $3,%eax
  6681. + and $0xc00,%eax
  6682. + ret
  6683. +
  6684. +.global fegetenv
  6685. +.type fegetenv,@function
  6686. +fegetenv:
  6687. + xor %eax,%eax
  6688. + fnstenv (%edi)
  6689. + stmxcsr 28(%edi)
  6690. + ret
  6691. +
  6692. +.global fesetenv
  6693. +.type fesetenv,@function
  6694. +fesetenv:
  6695. + xor %eax,%eax
  6696. + inc %edi
  6697. + jz 1f
  6698. + fldenv -1(%edi)
  6699. + ldmxcsr 27(%edi)
  6700. + ret
  6701. +1: push %rax
  6702. + push %rax
  6703. + pushq $0xffff
  6704. + pushq $0x37f
  6705. + fldenv (%esp)
  6706. + pushq $0x1f80
  6707. + ldmxcsr (%esp)
  6708. + add $40,%esp
  6709. + ret
  6710. +
  6711. +.global fetestexcept
  6712. +.type fetestexcept,@function
  6713. +fetestexcept:
  6714. + and $0x3f,%edi
  6715. + push %rax
  6716. + stmxcsr (%esp)
  6717. + pop %rsi
  6718. + fnstsw %ax
  6719. + or %esi,%eax
  6720. + and %edi,%eax
  6721. + ret
  6722. diff -Nur musl-0.9.15/src/fenv/x86_64/fenv.s musl-git/src/fenv/x86_64/fenv.s
  6723. --- musl-0.9.15/src/fenv/x86_64/fenv.s 2014-01-03 21:12:17.000000000 +0100
  6724. +++ musl-git/src/fenv/x86_64/fenv.s 2014-03-19 07:42:48.000000000 +0100
  6725. @@ -76,7 +76,7 @@
  6726. ret
  6727. 1: push %rax
  6728. push %rax
  6729. - push %rax
  6730. + pushq $0xffff
  6731. pushq $0x37f
  6732. fldenv (%rsp)
  6733. pushq $0x1f80
  6734. diff -Nur musl-0.9.15/src/internal/sh/syscall.s musl-git/src/internal/sh/syscall.s
  6735. --- musl-0.9.15/src/internal/sh/syscall.s 1970-01-01 01:00:00.000000000 +0100
  6736. +++ musl-git/src/internal/sh/syscall.s 2014-03-19 07:42:48.000000000 +0100
  6737. @@ -0,0 +1,22 @@
  6738. +.global __syscall
  6739. +.type __syscall, @function
  6740. +__syscall:
  6741. + ! The kernel syscall entry point documents that the trap number indicates
  6742. + ! the number of arguments being passed, but it then ignores that information.
  6743. + ! Since we do not actually know how many arguments are being passed, we will
  6744. + ! say there are six, since that is the maximum we support here.
  6745. + mov r4, r3
  6746. + mov r5, r4
  6747. + mov r6, r5
  6748. + mov r7, r6
  6749. + mov.l @r15, r7
  6750. + mov.l @(4,r15), r0
  6751. + mov.l @(8,r15), r1
  6752. + trapa #22
  6753. + or r0, r0
  6754. + or r0, r0
  6755. + or r0, r0
  6756. + or r0, r0
  6757. + or r0, r0
  6758. + rts
  6759. + nop
  6760. diff -Nur musl-0.9.15/src/internal/stdio_impl.h musl-git/src/internal/stdio_impl.h
  6761. --- musl-0.9.15/src/internal/stdio_impl.h 2014-01-03 21:12:17.000000000 +0100
  6762. +++ musl-git/src/internal/stdio_impl.h 2014-03-19 07:42:48.000000000 +0100
  6763. @@ -17,6 +17,7 @@
  6764. #define F_EOF 16
  6765. #define F_ERR 32
  6766. #define F_SVB 64
  6767. +#define F_APP 128
  6768. struct _IO_FILE {
  6769. unsigned flags;
  6770. diff -Nur musl-0.9.15/src/internal/syscall.h musl-git/src/internal/syscall.h
  6771. --- musl-0.9.15/src/internal/syscall.h 2014-01-03 21:12:17.000000000 +0100
  6772. +++ musl-git/src/internal/syscall.h 2014-03-19 07:42:48.000000000 +0100
  6773. @@ -1,22 +1,28 @@
  6774. #ifndef _INTERNAL_SYSCALL_H
  6775. #define _INTERNAL_SYSCALL_H
  6776. -#if defined(__PIC__) && (100*__GNUC__+__GNUC_MINOR__ >= 303)
  6777. -__attribute__((visibility("protected")))
  6778. -#endif
  6779. -long __syscall_ret(unsigned long), __syscall(long, ...),
  6780. - __syscall_cp(long, long, long, long, long, long, long);
  6781. -
  6782. #include <sys/syscall.h>
  6783. #include "syscall_arch.h"
  6784. -#define __syscall1(n,a) __syscall1(n,(long)(a))
  6785. -#define __syscall2(n,a,b) __syscall2(n,(long)(a),(long)(b))
  6786. -#define __syscall3(n,a,b,c) __syscall3(n,(long)(a),(long)(b),(long)(c))
  6787. -#define __syscall4(n,a,b,c,d) __syscall4(n,(long)(a),(long)(b),(long)(c),(long)(d))
  6788. -#define __syscall5(n,a,b,c,d,e) __syscall5(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e))
  6789. -#define __syscall6(n,a,b,c,d,e,f) __syscall6(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f))
  6790. -#define __syscall7(n,a,b,c,d,e,f,g) (__syscall)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f),(long)g)
  6791. +#ifndef __scc
  6792. +#define __scc(X) ((long) (X))
  6793. +typedef long syscall_arg_t;
  6794. +#endif
  6795. +
  6796. +#if defined(__PIC__) && (100*__GNUC__+__GNUC_MINOR__ >= 303)
  6797. +__attribute__((visibility("protected")))
  6798. +#endif
  6799. +long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
  6800. + __syscall_cp(syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t,
  6801. + syscall_arg_t, syscall_arg_t, syscall_arg_t);
  6802. +
  6803. +#define __syscall1(n,a) __syscall1(n,__scc(a))
  6804. +#define __syscall2(n,a,b) __syscall2(n,__scc(a),__scc(b))
  6805. +#define __syscall3(n,a,b,c) __syscall3(n,__scc(a),__scc(b),__scc(c))
  6806. +#define __syscall4(n,a,b,c,d) __syscall4(n,__scc(a),__scc(b),__scc(c),__scc(d))
  6807. +#define __syscall5(n,a,b,c,d,e) __syscall5(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e))
  6808. +#define __syscall6(n,a,b,c,d,e,f) __syscall6(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f))
  6809. +#define __syscall7(n,a,b,c,d,e,f,g) (__syscall)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f),__scc(g))
  6810. #define __SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
  6811. #define __SYSCALL_NARGS(...) __SYSCALL_NARGS_X(__VA_ARGS__,7,6,5,4,3,2,1,0,)
  6812. @@ -31,12 +37,12 @@
  6813. #define socketcall_cp __socketcall_cp
  6814. #define __syscall_cp0(n) (__syscall_cp)(n,0,0,0,0,0,0)
  6815. -#define __syscall_cp1(n,a) (__syscall_cp)(n,(long)(a),0,0,0,0,0)
  6816. -#define __syscall_cp2(n,a,b) (__syscall_cp)(n,(long)(a),(long)(b),0,0,0,0)
  6817. -#define __syscall_cp3(n,a,b,c) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),0,0,0)
  6818. -#define __syscall_cp4(n,a,b,c,d) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),0,0)
  6819. -#define __syscall_cp5(n,a,b,c,d,e) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),0)
  6820. -#define __syscall_cp6(n,a,b,c,d,e,f) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f))
  6821. +#define __syscall_cp1(n,a) (__syscall_cp)(n,__scc(a),0,0,0,0,0)
  6822. +#define __syscall_cp2(n,a,b) (__syscall_cp)(n,__scc(a),__scc(b),0,0,0,0)
  6823. +#define __syscall_cp3(n,a,b,c) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),0,0,0)
  6824. +#define __syscall_cp4(n,a,b,c,d) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),0,0)
  6825. +#define __syscall_cp5(n,a,b,c,d,e) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),0)
  6826. +#define __syscall_cp6(n,a,b,c,d,e,f) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f))
  6827. #define __syscall_cp(...) __SYSCALL_DISP(__syscall_cp,__VA_ARGS__)
  6828. #define syscall_cp(...) __syscall_ret(__syscall_cp(__VA_ARGS__))
  6829. diff -Nur musl-0.9.15/src/internal/x32/syscall.s musl-git/src/internal/x32/syscall.s
  6830. --- musl-0.9.15/src/internal/x32/syscall.s 1970-01-01 01:00:00.000000000 +0100
  6831. +++ musl-git/src/internal/x32/syscall.s 2014-03-19 07:42:48.000000000 +0100
  6832. @@ -0,0 +1,12 @@
  6833. +.global __syscall
  6834. +.type __syscall,@function
  6835. +__syscall:
  6836. + movq %rdi,%rax
  6837. + movq %rsi,%rdi
  6838. + movq %rdx,%rsi
  6839. + movq %rcx,%rdx
  6840. + movq %r8,%r10
  6841. + movq %r9,%r8
  6842. + movq 8(%rsp),%r9
  6843. + syscall
  6844. + ret
  6845. diff -Nur musl-0.9.15/src/ipc/semctl.c musl-git/src/ipc/semctl.c
  6846. --- musl-0.9.15/src/ipc/semctl.c 2014-01-03 21:12:17.000000000 +0100
  6847. +++ musl-git/src/ipc/semctl.c 2014-03-19 07:42:48.000000000 +0100
  6848. @@ -3,16 +3,26 @@
  6849. #include "syscall.h"
  6850. #include "ipc.h"
  6851. +union semun {
  6852. + int val;
  6853. + struct semid_ds *buf;
  6854. + unsigned short *array;
  6855. +};
  6856. +
  6857. int semctl(int id, int num, int cmd, ...)
  6858. {
  6859. - long arg;
  6860. + union semun arg = {0};
  6861. va_list ap;
  6862. - va_start(ap, cmd);
  6863. - arg = va_arg(ap, long);
  6864. - va_end(ap);
  6865. + switch (cmd) {
  6866. + case SETVAL: case GETALL: case SETALL: case IPC_STAT: case IPC_SET:
  6867. + case IPC_INFO: case SEM_INFO: case SEM_STAT:
  6868. + va_start(ap, cmd);
  6869. + arg = va_arg(ap, union semun);
  6870. + va_end(ap);
  6871. + }
  6872. #ifdef SYS_semctl
  6873. - return syscall(SYS_semctl, id, num, cmd | IPC_64, arg);
  6874. + return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
  6875. #else
  6876. - return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg);
  6877. + return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
  6878. #endif
  6879. }
  6880. diff -Nur musl-0.9.15/src/ldso/dladdr.c musl-git/src/ldso/dladdr.c
  6881. --- musl-0.9.15/src/ldso/dladdr.c 2014-01-03 21:12:17.000000000 +0100
  6882. +++ musl-git/src/ldso/dladdr.c 2014-03-19 07:42:48.000000000 +0100
  6883. @@ -1,9 +1,9 @@
  6884. #define _GNU_SOURCE
  6885. #include <dlfcn.h>
  6886. -int __dladdr(void *, Dl_info *);
  6887. +int __dladdr(const void *, Dl_info *);
  6888. -int dladdr(void *addr, Dl_info *info)
  6889. +int dladdr(const void *addr, Dl_info *info)
  6890. {
  6891. return __dladdr(addr, info);
  6892. }
  6893. diff -Nur musl-0.9.15/src/ldso/dynlink.c musl-git/src/ldso/dynlink.c
  6894. --- musl-0.9.15/src/ldso/dynlink.c 2014-01-03 21:12:17.000000000 +0100
  6895. +++ musl-git/src/ldso/dynlink.c 2014-03-19 07:42:48.000000000 +0100
  6896. @@ -253,7 +253,8 @@
  6897. name = strings + sym->st_name;
  6898. ctx = IS_COPY(type) ? head->next : head;
  6899. def = find_sym(ctx, name, IS_PLT(type));
  6900. - if (!def.sym && sym->st_info>>4 != STB_WEAK) {
  6901. + if (!def.sym && (sym->st_shndx != SHN_UNDEF
  6902. + || sym->st_info>>4 != STB_WEAK)) {
  6903. snprintf(errbuf, sizeof errbuf,
  6904. "Error relocating %s: %s: symbol not found",
  6905. dso->name, name);
  6906. @@ -1331,7 +1332,7 @@
  6907. return 0;
  6908. }
  6909. -int __dladdr(void *addr, Dl_info *info)
  6910. +int __dladdr(const void *addr, Dl_info *info)
  6911. {
  6912. struct dso *p;
  6913. Sym *sym;
  6914. @@ -1441,7 +1442,7 @@
  6915. {
  6916. return 0;
  6917. }
  6918. -int __dladdr (void *addr, Dl_info *info)
  6919. +int __dladdr (const void *addr, Dl_info *info)
  6920. {
  6921. return 0;
  6922. }
  6923. diff -Nur musl-0.9.15/src/ldso/sh/dlsym.s musl-git/src/ldso/sh/dlsym.s
  6924. --- musl-0.9.15/src/ldso/sh/dlsym.s 1970-01-01 01:00:00.000000000 +0100
  6925. +++ musl-git/src/ldso/sh/dlsym.s 2014-03-19 07:42:48.000000000 +0100
  6926. @@ -0,0 +1,10 @@
  6927. +.text
  6928. +.global dlsym
  6929. +.type dlsym, @function
  6930. +dlsym:
  6931. + mov.l L1, r0
  6932. + braf r0
  6933. +1: mov.l @r15, r6
  6934. +
  6935. +.align 2
  6936. +L1: .long __dlsym@PLT-(1b-.)
  6937. diff -Nur musl-0.9.15/src/ldso/sh/start.s musl-git/src/ldso/sh/start.s
  6938. --- musl-0.9.15/src/ldso/sh/start.s 1970-01-01 01:00:00.000000000 +0100
  6939. +++ musl-git/src/ldso/sh/start.s 2014-03-19 07:42:48.000000000 +0100
  6940. @@ -0,0 +1,26 @@
  6941. +.text
  6942. +.global _start
  6943. +.type _start, @function
  6944. +_start:
  6945. + mov.l @r15, r4
  6946. + mov r15, r5
  6947. + mov.l L1, r0
  6948. + bsrf r0
  6949. + add #4, r5
  6950. +
  6951. +2: mov r0, r2
  6952. + mov.l @r15+, r1
  6953. +1: mov.l @r15+, r0
  6954. + cmp/eq #-1, r0
  6955. + bt/s 1b
  6956. + add #-1, r1
  6957. +
  6958. + add #1, r1
  6959. + mov.l r0, @-r15
  6960. + mov.l r1, @-r15
  6961. + mov #0, r4
  6962. + jmp @r2
  6963. + nop
  6964. +
  6965. +.align 2
  6966. +L1: .long __dynlink@PLT-(2b-.)
  6967. diff -Nur musl-0.9.15/src/ldso/x32/dlsym.s musl-git/src/ldso/x32/dlsym.s
  6968. --- musl-0.9.15/src/ldso/x32/dlsym.s 1970-01-01 01:00:00.000000000 +0100
  6969. +++ musl-git/src/ldso/x32/dlsym.s 2014-03-19 07:42:48.000000000 +0100
  6970. @@ -0,0 +1,6 @@
  6971. +.text
  6972. +.global dlsym
  6973. +.type dlsym,@function
  6974. +dlsym:
  6975. + mov (%rsp),%rdx
  6976. + jmp __dlsym
  6977. diff -Nur musl-0.9.15/src/ldso/x32/start.s musl-git/src/ldso/x32/start.s
  6978. --- musl-0.9.15/src/ldso/x32/start.s 1970-01-01 01:00:00.000000000 +0100
  6979. +++ musl-git/src/ldso/x32/start.s 2014-03-19 07:42:48.000000000 +0100
  6980. @@ -0,0 +1,24 @@
  6981. +.text
  6982. +.global _start
  6983. +_start:
  6984. + mov (%rsp),%rdi /* move argc into 1st argument slot */
  6985. + lea 4(%rsp),%rsi /* move argv into 2nd argument slot */
  6986. + call __dynlink
  6987. + /* in case the dynlinker was called directly, it sets the "consumed"
  6988. + argv values to -1. so we must loop over the array as long as -1
  6989. + is in the top argv slot, decrement argc, and then set the stackpointer
  6990. + to the new argc as well as argc's new value.
  6991. + as the x32 abi has longs in the argv array, we cannot use push/pop.*/
  6992. + movl (%rsp),%edi /* copy argc into edi */
  6993. + xor %rdx,%rdx /* we use rdx as an offset to the current argv member */
  6994. +1: dec %edi
  6995. + addl $4, %edx
  6996. + movl (%rsp, %rdx), %esi
  6997. + cmp $-1,%esi
  6998. + jz 1b
  6999. + inc %edi
  7000. + subl $4, %edx
  7001. + lea (%rsp, %rdx), %rsp /* set rsp to new argv[-1] */
  7002. + movl %edi, (%rsp) /* write new argc there */
  7003. + xor %edx,%edx
  7004. + jmp *%rax
  7005. diff -Nur musl-0.9.15/src/linux/clone.c musl-git/src/linux/clone.c
  7006. --- musl-0.9.15/src/linux/clone.c 1970-01-01 01:00:00.000000000 +0100
  7007. +++ musl-git/src/linux/clone.c 2014-03-19 07:42:48.000000000 +0100
  7008. @@ -0,0 +1,19 @@
  7009. +#include <stdarg.h>
  7010. +#include <unistd.h>
  7011. +#include "pthread_impl.h"
  7012. +#include "syscall.h"
  7013. +
  7014. +int clone(int (*func)(void *), void *stack, int flags, void *arg, ...)
  7015. +{
  7016. + va_list ap;
  7017. + pid_t *ptid, *ctid;
  7018. + void *tls;
  7019. +
  7020. + va_start(ap, arg);
  7021. + ptid = va_arg(ap, pid_t *);
  7022. + tls = va_arg(ap, void *);
  7023. + ctid = va_arg(ap, pid_t *);
  7024. + va_end(ap);
  7025. +
  7026. + return __syscall_ret(__clone(func, stack, flags, arg, ptid, tls, ctid));
  7027. +}
  7028. diff -Nur musl-0.9.15/src/linux/fallocate.c musl-git/src/linux/fallocate.c
  7029. --- musl-0.9.15/src/linux/fallocate.c 2014-01-03 21:12:17.000000000 +0100
  7030. +++ musl-git/src/linux/fallocate.c 2014-03-19 07:42:48.000000000 +0100
  7031. @@ -1,9 +1,13 @@
  7032. #define _GNU_SOURCE
  7033. #include <fcntl.h>
  7034. #include "syscall.h"
  7035. +#include "libc.h"
  7036. int fallocate(int fd, int mode, off_t base, off_t len)
  7037. {
  7038. return syscall(SYS_fallocate, fd, mode, __SYSCALL_LL_E(base),
  7039. __SYSCALL_LL_E(len));
  7040. }
  7041. +
  7042. +#undef fallocate64
  7043. +LFS64(fallocate);
  7044. diff -Nur musl-0.9.15/src/linux/inotify.c musl-git/src/linux/inotify.c
  7045. --- musl-0.9.15/src/linux/inotify.c 2014-01-03 21:12:17.000000000 +0100
  7046. +++ musl-git/src/linux/inotify.c 2014-03-19 07:42:48.000000000 +0100
  7047. @@ -15,7 +15,7 @@
  7048. return syscall(SYS_inotify_add_watch, fd, pathname, mask);
  7049. }
  7050. -int inotify_rm_watch(int fd, uint32_t wd)
  7051. +int inotify_rm_watch(int fd, int wd)
  7052. {
  7053. return syscall(SYS_inotify_rm_watch, fd, wd);
  7054. }
  7055. diff -Nur musl-0.9.15/src/linux/remap_file_pages.c musl-git/src/linux/remap_file_pages.c
  7056. --- musl-0.9.15/src/linux/remap_file_pages.c 2014-01-03 21:12:17.000000000 +0100
  7057. +++ musl-git/src/linux/remap_file_pages.c 2014-03-19 07:42:48.000000000 +0100
  7058. @@ -2,7 +2,7 @@
  7059. #include <sys/mman.h>
  7060. #include "syscall.h"
  7061. -int remap_file_pages(void *addr, size_t size, int prot, ssize_t pgoff, int flags)
  7062. +int remap_file_pages(void *addr, size_t size, int prot, size_t pgoff, int flags)
  7063. {
  7064. return syscall(SYS_remap_file_pages, addr, size, prot, pgoff, flags);
  7065. }
  7066. diff -Nur musl-0.9.15/src/linux/stime.c musl-git/src/linux/stime.c
  7067. --- musl-0.9.15/src/linux/stime.c 2014-01-03 21:12:17.000000000 +0100
  7068. +++ musl-git/src/linux/stime.c 2014-03-19 07:42:48.000000000 +0100
  7069. @@ -2,7 +2,7 @@
  7070. #include <time.h>
  7071. #include <sys/time.h>
  7072. -int stime(time_t *t)
  7073. +int stime(const time_t *t)
  7074. {
  7075. struct timeval tv = { .tv_sec = *t, .tv_usec = 0 };
  7076. return settimeofday(&tv, (void *)0);
  7077. diff -Nur musl-0.9.15/src/linux/x32/sysinfo.s musl-git/src/linux/x32/sysinfo.s
  7078. --- musl-0.9.15/src/linux/x32/sysinfo.s 1970-01-01 01:00:00.000000000 +0100
  7079. +++ musl-git/src/linux/x32/sysinfo.s 2014-03-19 07:42:48.000000000 +0100
  7080. @@ -0,0 +1,5 @@
  7081. +.text
  7082. +.global sysinfo
  7083. +.type sysinfo,@function
  7084. +sysinfo:
  7085. + jmp __x32_sysinfo
  7086. diff -Nur musl-0.9.15/src/locale/wcsxfrm.c musl-git/src/locale/wcsxfrm.c
  7087. --- musl-0.9.15/src/locale/wcsxfrm.c 2014-01-03 21:12:17.000000000 +0100
  7088. +++ musl-git/src/locale/wcsxfrm.c 2014-03-19 07:42:48.000000000 +0100
  7089. @@ -6,10 +6,12 @@
  7090. size_t __wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc)
  7091. {
  7092. size_t l = wcslen(src);
  7093. - if (l >= n) {
  7094. + if (l < n) {
  7095. + wmemcpy(dest, src, l+1);
  7096. + } else if (n) {
  7097. wmemcpy(dest, src, n-1);
  7098. dest[n-1] = 0;
  7099. - } else wcscpy(dest, src);
  7100. + }
  7101. return l;
  7102. }
  7103. diff -Nur musl-0.9.15/src/math/i386/remainderf.s musl-git/src/math/i386/remainderf.s
  7104. --- musl-0.9.15/src/math/i386/remainderf.s 2014-01-03 21:12:18.000000000 +0100
  7105. +++ musl-git/src/math/i386/remainderf.s 2014-03-19 07:42:48.000000000 +0100
  7106. @@ -1,6 +1,9 @@
  7107. .global remainderf
  7108. .type remainderf,@function
  7109. remainderf:
  7110. +.weak dremf
  7111. +.type dremf,@function
  7112. +dremf:
  7113. flds 8(%esp)
  7114. flds 4(%esp)
  7115. 1: fprem1
  7116. diff -Nur musl-0.9.15/src/math/i386/remainder.s musl-git/src/math/i386/remainder.s
  7117. --- musl-0.9.15/src/math/i386/remainder.s 2014-01-03 21:12:18.000000000 +0100
  7118. +++ musl-git/src/math/i386/remainder.s 2014-03-19 07:42:48.000000000 +0100
  7119. @@ -1,6 +1,9 @@
  7120. .global remainder
  7121. .type remainder,@function
  7122. remainder:
  7123. +.weak drem
  7124. +.type drem,@function
  7125. +drem:
  7126. fldl 12(%esp)
  7127. fldl 4(%esp)
  7128. 1: fprem1
  7129. diff -Nur musl-0.9.15/src/math/x32/acosl.s musl-git/src/math/x32/acosl.s
  7130. --- musl-0.9.15/src/math/x32/acosl.s 1970-01-01 01:00:00.000000000 +0100
  7131. +++ musl-git/src/math/x32/acosl.s 2014-03-19 07:42:48.000000000 +0100
  7132. @@ -0,0 +1,16 @@
  7133. +# see ../i386/acos.s
  7134. +
  7135. +.global acosl
  7136. +.type acosl,@function
  7137. +acosl:
  7138. + fldt 8(%esp)
  7139. +1: fld %st(0)
  7140. + fld1
  7141. + fsub %st(0),%st(1)
  7142. + fadd %st(2)
  7143. + fmulp
  7144. + fsqrt
  7145. + fabs
  7146. + fxch %st(1)
  7147. + fpatan
  7148. + ret
  7149. diff -Nur musl-0.9.15/src/math/x32/asinl.s musl-git/src/math/x32/asinl.s
  7150. --- musl-0.9.15/src/math/x32/asinl.s 1970-01-01 01:00:00.000000000 +0100
  7151. +++ musl-git/src/math/x32/asinl.s 2014-03-19 07:42:48.000000000 +0100
  7152. @@ -0,0 +1,12 @@
  7153. +.global asinl
  7154. +.type asinl,@function
  7155. +asinl:
  7156. + fldt 8(%esp)
  7157. +1: fld %st(0)
  7158. + fld1
  7159. + fsub %st(0),%st(1)
  7160. + fadd %st(2)
  7161. + fmulp
  7162. + fsqrt
  7163. + fpatan
  7164. + ret
  7165. diff -Nur musl-0.9.15/src/math/x32/atan2l.s musl-git/src/math/x32/atan2l.s
  7166. --- musl-0.9.15/src/math/x32/atan2l.s 1970-01-01 01:00:00.000000000 +0100
  7167. +++ musl-git/src/math/x32/atan2l.s 2014-03-19 07:42:48.000000000 +0100
  7168. @@ -0,0 +1,7 @@
  7169. +.global atan2l
  7170. +.type atan2l,@function
  7171. +atan2l:
  7172. + fldt 8(%esp)
  7173. + fldt 24(%esp)
  7174. + fpatan
  7175. + ret
  7176. diff -Nur musl-0.9.15/src/math/x32/atanl.s musl-git/src/math/x32/atanl.s
  7177. --- musl-0.9.15/src/math/x32/atanl.s 1970-01-01 01:00:00.000000000 +0100
  7178. +++ musl-git/src/math/x32/atanl.s 2014-03-19 07:42:48.000000000 +0100
  7179. @@ -0,0 +1,7 @@
  7180. +.global atanl
  7181. +.type atanl,@function
  7182. +atanl:
  7183. + fldt 8(%esp)
  7184. + fld1
  7185. + fpatan
  7186. + ret
  7187. diff -Nur musl-0.9.15/src/math/x32/ceill.s musl-git/src/math/x32/ceill.s
  7188. --- musl-0.9.15/src/math/x32/ceill.s 1970-01-01 01:00:00.000000000 +0100
  7189. +++ musl-git/src/math/x32/ceill.s 2014-03-19 07:42:48.000000000 +0100
  7190. @@ -0,0 +1 @@
  7191. +# see floorl.s
  7192. diff -Nur musl-0.9.15/src/math/x32/exp2l.s musl-git/src/math/x32/exp2l.s
  7193. --- musl-0.9.15/src/math/x32/exp2l.s 1970-01-01 01:00:00.000000000 +0100
  7194. +++ musl-git/src/math/x32/exp2l.s 2014-03-19 07:42:48.000000000 +0100
  7195. @@ -0,0 +1,90 @@
  7196. +.global expm1l
  7197. +.type expm1l,@function
  7198. +expm1l:
  7199. + fldt 8(%esp)
  7200. + fldl2e
  7201. + fmulp
  7202. + movl $0xc2820000,-4(%esp)
  7203. + flds -4(%esp)
  7204. + fucomp %st(1)
  7205. + fnstsw %ax
  7206. + sahf
  7207. + fld1
  7208. + jb 1f
  7209. + # x*log2e <= -65, return -1 without underflow
  7210. + fstp %st(1)
  7211. + fchs
  7212. + ret
  7213. +1: fld %st(1)
  7214. + fabs
  7215. + fucom %st(1)
  7216. + fnstsw %ax
  7217. + fstp %st(0)
  7218. + fstp %st(0)
  7219. + sahf
  7220. + ja 1f
  7221. + f2xm1
  7222. + ret
  7223. +1: push %rax
  7224. + call 1f
  7225. + pop %rax
  7226. + fld1
  7227. + fsubrp
  7228. + ret
  7229. +
  7230. +.global exp2l
  7231. +.type exp2l,@function
  7232. +exp2l:
  7233. + fldt 8(%esp)
  7234. +1: fld %st(0)
  7235. + sub $16,%esp
  7236. + fstpt (%esp)
  7237. + mov 8(%esp),%ax
  7238. + and $0x7fff,%ax
  7239. + cmp $0x3fff+13,%ax
  7240. + jb 4f # |x| < 8192
  7241. + cmp $0x3fff+15,%ax
  7242. + jae 3f # |x| >= 32768
  7243. + fsts (%esp)
  7244. + cmpl $0xc67ff800,(%esp)
  7245. + jb 2f # x > -16382
  7246. + movl $0x5f000000,(%esp)
  7247. + flds (%esp) # 0x1p63
  7248. + fld %st(1)
  7249. + fsub %st(1)
  7250. + faddp
  7251. + fucomp %st(1)
  7252. + fnstsw
  7253. + sahf
  7254. + je 2f # x - 0x1p63 + 0x1p63 == x
  7255. + movl $1,(%esp)
  7256. + flds (%esp) # 0x1p-149
  7257. + fdiv %st(1)
  7258. + fstps (%esp) # raise underflow
  7259. +2: fld1
  7260. + fld %st(1)
  7261. + frndint
  7262. + fxch %st(2)
  7263. + fsub %st(2) # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
  7264. + f2xm1
  7265. + faddp # 2^(x-rint(x))
  7266. +1: fscale
  7267. + fstp %st(1)
  7268. + add $16,%esp
  7269. + ret
  7270. +3: xor %eax,%eax
  7271. +4: cmp $0x3fff-64,%ax
  7272. + fld1
  7273. + jb 1b # |x| < 0x1p-64
  7274. + fstpt (%esp)
  7275. + fistl 8(%esp)
  7276. + fildl 8(%esp)
  7277. + fsubrp %st(1)
  7278. + addl $0x3fff,8(%esp)
  7279. + f2xm1
  7280. + fld1
  7281. + faddp # 2^(x-rint(x))
  7282. + fldt (%esp) # 2^rint(x)
  7283. + fmulp
  7284. + add $16,%esp
  7285. + ret
  7286. diff -Nur musl-0.9.15/src/math/x32/expl.s musl-git/src/math/x32/expl.s
  7287. --- musl-0.9.15/src/math/x32/expl.s 1970-01-01 01:00:00.000000000 +0100
  7288. +++ musl-git/src/math/x32/expl.s 2014-03-19 07:42:48.000000000 +0100
  7289. @@ -0,0 +1,101 @@
  7290. +# exp(x) = 2^hi + 2^hi (2^lo - 1)
  7291. +# where hi+lo = log2e*x with 128bit precision
  7292. +# exact log2e*x calculation depends on nearest rounding mode
  7293. +# using the exact multiplication method of Dekker and Veltkamp
  7294. +
  7295. +.global expl
  7296. +.type expl,@function
  7297. +expl:
  7298. + fldt 8(%esp)
  7299. +
  7300. + # interesting case: 0x1p-32 <= |x| < 16384
  7301. + # check if (exponent|0x8000) is in [0xbfff-32, 0xbfff+13]
  7302. + mov 16(%esp), %ax
  7303. + or $0x8000, %ax
  7304. + sub $0xbfdf, %ax
  7305. + cmp $45, %ax
  7306. + jbe 2f
  7307. + test %ax, %ax
  7308. + fld1
  7309. + js 1f
  7310. + # if |x|>=0x1p14 or nan return 2^trunc(x)
  7311. + fscale
  7312. + fstp %st(1)
  7313. + ret
  7314. + # if |x|<0x1p-32 return 1+x
  7315. +1: faddp
  7316. + ret
  7317. +
  7318. + # should be 0x1.71547652b82fe178p0L == 0x3fff b8aa3b29 5c17f0bc
  7319. + # it will be wrong on non-nearest rounding mode
  7320. +2: fldl2e
  7321. + sub $48, %esp
  7322. + # hi = log2e_hi*x
  7323. + # 2^hi = exp2l(hi)
  7324. + fmul %st(1),%st
  7325. + fld %st(0)
  7326. + fstpt (%esp)
  7327. + fstpt 16(%esp)
  7328. + fstpt 32(%esp)
  7329. + call exp2l
  7330. + # if 2^hi == inf return 2^hi
  7331. + fld %st(0)
  7332. + fstpt (%esp)
  7333. + cmpw $0x7fff, 8(%esp)
  7334. + je 1f
  7335. + fldt 32(%esp)
  7336. + fldt 16(%esp)
  7337. + # fpu stack: 2^hi x hi
  7338. + # exact mult: x*log2e
  7339. + fld %st(1)
  7340. + # c = 0x1p32+1
  7341. + movq $0x41f0000000100000,%rax
  7342. + pushq %rax
  7343. + fldl (%esp)
  7344. + # xh = x - c*x + c*x
  7345. + # xl = x - xh
  7346. + fmulp
  7347. + fld %st(2)
  7348. + fsub %st(1), %st
  7349. + faddp
  7350. + fld %st(2)
  7351. + fsub %st(1), %st
  7352. + # yh = log2e_hi - c*log2e_hi + c*log2e_hi
  7353. + movq $0x3ff7154765200000,%rax
  7354. + pushq %rax
  7355. + fldl (%esp)
  7356. + # fpu stack: 2^hi x hi xh xl yh
  7357. + # lo = hi - xh*yh + xl*yh
  7358. + fld %st(2)
  7359. + fmul %st(1), %st
  7360. + fsubp %st, %st(4)
  7361. + fmul %st(1), %st
  7362. + faddp %st, %st(3)
  7363. + # yl = log2e_hi - yh
  7364. + movq $0x3de705fc2f000000,%rax
  7365. + pushq %rax
  7366. + fldl (%esp)
  7367. + # fpu stack: 2^hi x lo xh xl yl
  7368. + # lo += xh*yl + xl*yl
  7369. + fmul %st, %st(2)
  7370. + fmulp %st, %st(1)
  7371. + fxch %st(2)
  7372. + faddp
  7373. + faddp
  7374. + # log2e_lo
  7375. + movq $0xbfbe,%rax
  7376. + pushq %rax
  7377. + movq $0x82f0025f2dc582ee,%rax
  7378. + pushq %rax
  7379. + fldt (%esp)
  7380. + add $40,%esp
  7381. + # fpu stack: 2^hi x lo log2e_lo
  7382. + # lo += log2e_lo*x
  7383. + # return 2^hi + 2^hi (2^lo - 1)
  7384. + fmulp %st, %st(2)
  7385. + faddp
  7386. + f2xm1
  7387. + fmul %st(1), %st
  7388. + faddp
  7389. +1: add $48, %esp
  7390. + ret
  7391. diff -Nur musl-0.9.15/src/math/x32/expm1l.s musl-git/src/math/x32/expm1l.s
  7392. --- musl-0.9.15/src/math/x32/expm1l.s 1970-01-01 01:00:00.000000000 +0100
  7393. +++ musl-git/src/math/x32/expm1l.s 2014-03-19 07:42:48.000000000 +0100
  7394. @@ -0,0 +1 @@
  7395. +# see exp2l.s
  7396. diff -Nur musl-0.9.15/src/math/x32/fabsf.s musl-git/src/math/x32/fabsf.s
  7397. --- musl-0.9.15/src/math/x32/fabsf.s 1970-01-01 01:00:00.000000000 +0100
  7398. +++ musl-git/src/math/x32/fabsf.s 2014-03-19 07:42:48.000000000 +0100
  7399. @@ -0,0 +1,7 @@
  7400. +.global fabsf
  7401. +.type fabsf,@function
  7402. +fabsf:
  7403. + mov $0x7fffffff,%eax
  7404. + movq %rax,%xmm1
  7405. + andps %xmm1,%xmm0
  7406. + ret
  7407. diff -Nur musl-0.9.15/src/math/x32/fabsl.s musl-git/src/math/x32/fabsl.s
  7408. --- musl-0.9.15/src/math/x32/fabsl.s 1970-01-01 01:00:00.000000000 +0100
  7409. +++ musl-git/src/math/x32/fabsl.s 2014-03-19 07:42:48.000000000 +0100
  7410. @@ -0,0 +1,6 @@
  7411. +.global fabsl
  7412. +.type fabsl,@function
  7413. +fabsl:
  7414. + fldt 8(%esp)
  7415. + fabs
  7416. + ret
  7417. diff -Nur musl-0.9.15/src/math/x32/fabs.s musl-git/src/math/x32/fabs.s
  7418. --- musl-0.9.15/src/math/x32/fabs.s 1970-01-01 01:00:00.000000000 +0100
  7419. +++ musl-git/src/math/x32/fabs.s 2014-03-19 07:42:48.000000000 +0100
  7420. @@ -0,0 +1,9 @@
  7421. +.global fabs
  7422. +.type fabs,@function
  7423. +fabs:
  7424. + xor %eax,%eax
  7425. + dec %rax
  7426. + shr %rax
  7427. + movq %rax,%xmm1
  7428. + andpd %xmm1,%xmm0
  7429. + ret
  7430. diff -Nur musl-0.9.15/src/math/x32/floorl.s musl-git/src/math/x32/floorl.s
  7431. --- musl-0.9.15/src/math/x32/floorl.s 1970-01-01 01:00:00.000000000 +0100
  7432. +++ musl-git/src/math/x32/floorl.s 2014-03-19 07:42:48.000000000 +0100
  7433. @@ -0,0 +1,27 @@
  7434. +.global floorl
  7435. +.type floorl,@function
  7436. +floorl:
  7437. + fldt 8(%esp)
  7438. +1: mov $0x7,%al
  7439. +1: fstcw 8(%esp)
  7440. + mov 9(%esp),%ah
  7441. + mov %al,9(%esp)
  7442. + fldcw 8(%esp)
  7443. + frndint
  7444. + mov %ah,9(%esp)
  7445. + fldcw 8(%esp)
  7446. + ret
  7447. +
  7448. +.global ceill
  7449. +.type ceill,@function
  7450. +ceill:
  7451. + fldt 8(%esp)
  7452. + mov $0xb,%al
  7453. + jmp 1b
  7454. +
  7455. +.global truncl
  7456. +.type truncl,@function
  7457. +truncl:
  7458. + fldt 8(%esp)
  7459. + mov $0xf,%al
  7460. + jmp 1b
  7461. diff -Nur musl-0.9.15/src/math/x32/fmodl.s musl-git/src/math/x32/fmodl.s
  7462. --- musl-0.9.15/src/math/x32/fmodl.s 1970-01-01 01:00:00.000000000 +0100
  7463. +++ musl-git/src/math/x32/fmodl.s 2014-03-19 07:42:48.000000000 +0100
  7464. @@ -0,0 +1,11 @@
  7465. +.global fmodl
  7466. +.type fmodl,@function
  7467. +fmodl:
  7468. + fldt 24(%esp)
  7469. + fldt 8(%esp)
  7470. +1: fprem
  7471. + fstsw %ax
  7472. + sahf
  7473. + jp 1b
  7474. + fstp %st(1)
  7475. + ret
  7476. diff -Nur musl-0.9.15/src/math/x32/llrintf.s musl-git/src/math/x32/llrintf.s
  7477. --- musl-0.9.15/src/math/x32/llrintf.s 1970-01-01 01:00:00.000000000 +0100
  7478. +++ musl-git/src/math/x32/llrintf.s 2014-03-19 07:42:48.000000000 +0100
  7479. @@ -0,0 +1,5 @@
  7480. +.global llrintf
  7481. +.type llrintf,@function
  7482. +llrintf:
  7483. + cvtss2si %xmm0,%rax
  7484. + ret
  7485. diff -Nur musl-0.9.15/src/math/x32/llrintl.s musl-git/src/math/x32/llrintl.s
  7486. --- musl-0.9.15/src/math/x32/llrintl.s 1970-01-01 01:00:00.000000000 +0100
  7487. +++ musl-git/src/math/x32/llrintl.s 2014-03-19 07:42:48.000000000 +0100
  7488. @@ -0,0 +1,7 @@
  7489. +.global llrintl
  7490. +.type llrintl,@function
  7491. +llrintl:
  7492. + fldt 8(%esp)
  7493. + fistpll 8(%esp)
  7494. + mov 8(%esp),%rax
  7495. + ret
  7496. diff -Nur musl-0.9.15/src/math/x32/llrint.s musl-git/src/math/x32/llrint.s
  7497. --- musl-0.9.15/src/math/x32/llrint.s 1970-01-01 01:00:00.000000000 +0100
  7498. +++ musl-git/src/math/x32/llrint.s 2014-03-19 07:42:48.000000000 +0100
  7499. @@ -0,0 +1,5 @@
  7500. +.global llrint
  7501. +.type llrint,@function
  7502. +llrint:
  7503. + cvtsd2si %xmm0,%rax
  7504. + ret
  7505. diff -Nur musl-0.9.15/src/math/x32/log10l.s musl-git/src/math/x32/log10l.s
  7506. --- musl-0.9.15/src/math/x32/log10l.s 1970-01-01 01:00:00.000000000 +0100
  7507. +++ musl-git/src/math/x32/log10l.s 2014-03-19 07:42:48.000000000 +0100
  7508. @@ -0,0 +1,7 @@
  7509. +.global log10l
  7510. +.type log10l,@function
  7511. +log10l:
  7512. + fldlg2
  7513. + fldt 8(%esp)
  7514. + fyl2x
  7515. + ret
  7516. diff -Nur musl-0.9.15/src/math/x32/log1pl.s musl-git/src/math/x32/log1pl.s
  7517. --- musl-0.9.15/src/math/x32/log1pl.s 1970-01-01 01:00:00.000000000 +0100
  7518. +++ musl-git/src/math/x32/log1pl.s 2014-03-19 07:42:48.000000000 +0100
  7519. @@ -0,0 +1,15 @@
  7520. +.global log1pl
  7521. +.type log1pl,@function
  7522. +log1pl:
  7523. + mov 14(%esp),%eax
  7524. + fldln2
  7525. + and $0x7fffffff,%eax
  7526. + fldt 8(%esp)
  7527. + cmp $0x3ffd9400,%eax
  7528. + ja 1f
  7529. + fyl2xp1
  7530. + ret
  7531. +1: fld1
  7532. + faddp
  7533. + fyl2x
  7534. + ret
  7535. diff -Nur musl-0.9.15/src/math/x32/log2l.s musl-git/src/math/x32/log2l.s
  7536. --- musl-0.9.15/src/math/x32/log2l.s 1970-01-01 01:00:00.000000000 +0100
  7537. +++ musl-git/src/math/x32/log2l.s 2014-03-19 07:42:48.000000000 +0100
  7538. @@ -0,0 +1,7 @@
  7539. +.global log2l
  7540. +.type log2l,@function
  7541. +log2l:
  7542. + fld1
  7543. + fldt 8(%esp)
  7544. + fyl2x
  7545. + ret
  7546. diff -Nur musl-0.9.15/src/math/x32/logl.s musl-git/src/math/x32/logl.s
  7547. --- musl-0.9.15/src/math/x32/logl.s 1970-01-01 01:00:00.000000000 +0100
  7548. +++ musl-git/src/math/x32/logl.s 2014-03-19 07:42:48.000000000 +0100
  7549. @@ -0,0 +1,7 @@
  7550. +.global logl
  7551. +.type logl,@function
  7552. +logl:
  7553. + fldln2
  7554. + fldt 8(%esp)
  7555. + fyl2x
  7556. + ret
  7557. diff -Nur musl-0.9.15/src/math/x32/lrintf.s musl-git/src/math/x32/lrintf.s
  7558. --- musl-0.9.15/src/math/x32/lrintf.s 1970-01-01 01:00:00.000000000 +0100
  7559. +++ musl-git/src/math/x32/lrintf.s 2014-03-19 07:42:48.000000000 +0100
  7560. @@ -0,0 +1,5 @@
  7561. +.global lrintf
  7562. +.type lrintf,@function
  7563. +lrintf:
  7564. + cvtss2si %xmm0,%rax
  7565. + ret
  7566. diff -Nur musl-0.9.15/src/math/x32/lrintl.s musl-git/src/math/x32/lrintl.s
  7567. --- musl-0.9.15/src/math/x32/lrintl.s 1970-01-01 01:00:00.000000000 +0100
  7568. +++ musl-git/src/math/x32/lrintl.s 2014-03-19 07:42:48.000000000 +0100
  7569. @@ -0,0 +1,7 @@
  7570. +.global lrintl
  7571. +.type lrintl,@function
  7572. +lrintl:
  7573. + fldt 8(%esp)
  7574. + fistpll 8(%esp)
  7575. + mov 8(%esp),%rax
  7576. + ret
  7577. diff -Nur musl-0.9.15/src/math/x32/lrint.s musl-git/src/math/x32/lrint.s
  7578. --- musl-0.9.15/src/math/x32/lrint.s 1970-01-01 01:00:00.000000000 +0100
  7579. +++ musl-git/src/math/x32/lrint.s 2014-03-19 07:42:48.000000000 +0100
  7580. @@ -0,0 +1,5 @@
  7581. +.global lrint
  7582. +.type lrint,@function
  7583. +lrint:
  7584. + cvtsd2si %xmm0,%rax
  7585. + ret
  7586. diff -Nur musl-0.9.15/src/math/x32/remainderl.s musl-git/src/math/x32/remainderl.s
  7587. --- musl-0.9.15/src/math/x32/remainderl.s 1970-01-01 01:00:00.000000000 +0100
  7588. +++ musl-git/src/math/x32/remainderl.s 2014-03-19 07:42:48.000000000 +0100
  7589. @@ -0,0 +1,11 @@
  7590. +.global remainderl
  7591. +.type remainderl,@function
  7592. +remainderl:
  7593. + fldt 24(%esp)
  7594. + fldt 8(%esp)
  7595. +1: fprem1
  7596. + fstsw %ax
  7597. + sahf
  7598. + jp 1b
  7599. + fstp %st(1)
  7600. + ret
  7601. diff -Nur musl-0.9.15/src/math/x32/rintl.s musl-git/src/math/x32/rintl.s
  7602. --- musl-0.9.15/src/math/x32/rintl.s 1970-01-01 01:00:00.000000000 +0100
  7603. +++ musl-git/src/math/x32/rintl.s 2014-03-19 07:42:48.000000000 +0100
  7604. @@ -0,0 +1,6 @@
  7605. +.global rintl
  7606. +.type rintl,@function
  7607. +rintl:
  7608. + fldt 8(%esp)
  7609. + frndint
  7610. + ret
  7611. diff -Nur musl-0.9.15/src/math/x32/sqrtf.s musl-git/src/math/x32/sqrtf.s
  7612. --- musl-0.9.15/src/math/x32/sqrtf.s 1970-01-01 01:00:00.000000000 +0100
  7613. +++ musl-git/src/math/x32/sqrtf.s 2014-03-19 07:42:48.000000000 +0100
  7614. @@ -0,0 +1,4 @@
  7615. +.global sqrtf
  7616. +.type sqrtf,@function
  7617. +sqrtf: sqrtss %xmm0, %xmm0
  7618. + ret
  7619. diff -Nur musl-0.9.15/src/math/x32/sqrtl.s musl-git/src/math/x32/sqrtl.s
  7620. --- musl-0.9.15/src/math/x32/sqrtl.s 1970-01-01 01:00:00.000000000 +0100
  7621. +++ musl-git/src/math/x32/sqrtl.s 2014-03-19 07:42:48.000000000 +0100
  7622. @@ -0,0 +1,5 @@
  7623. +.global sqrtl
  7624. +.type sqrtl,@function
  7625. +sqrtl: fldt 8(%esp)
  7626. + fsqrt
  7627. + ret
  7628. diff -Nur musl-0.9.15/src/math/x32/sqrt.s musl-git/src/math/x32/sqrt.s
  7629. --- musl-0.9.15/src/math/x32/sqrt.s 1970-01-01 01:00:00.000000000 +0100
  7630. +++ musl-git/src/math/x32/sqrt.s 2014-03-19 07:42:48.000000000 +0100
  7631. @@ -0,0 +1,4 @@
  7632. +.global sqrt
  7633. +.type sqrt,@function
  7634. +sqrt: sqrtsd %xmm0, %xmm0
  7635. + ret
  7636. diff -Nur musl-0.9.15/src/math/x32/truncl.s musl-git/src/math/x32/truncl.s
  7637. --- musl-0.9.15/src/math/x32/truncl.s 1970-01-01 01:00:00.000000000 +0100
  7638. +++ musl-git/src/math/x32/truncl.s 2014-03-19 07:42:48.000000000 +0100
  7639. @@ -0,0 +1 @@
  7640. +# see floorl.s
  7641. diff -Nur musl-0.9.15/src/misc/nftw.c musl-git/src/misc/nftw.c
  7642. --- musl-0.9.15/src/misc/nftw.c 2014-01-03 21:12:18.000000000 +0100
  7643. +++ musl-git/src/misc/nftw.c 2014-03-19 07:42:48.000000000 +0100
  7644. @@ -46,8 +46,7 @@
  7645. type = FTW_F;
  7646. }
  7647. - if ((flags & FTW_MOUNT) && h
  7648. - && (st.st_dev != h->dev || st.st_ino != h->ino))
  7649. + if ((flags & FTW_MOUNT) && h && st.st_dev != h->dev)
  7650. return 0;
  7651. new.chain = h;
  7652. diff -Nur musl-0.9.15/src/misc/pty.c musl-git/src/misc/pty.c
  7653. --- musl-0.9.15/src/misc/pty.c 2014-01-03 21:12:18.000000000 +0100
  7654. +++ musl-git/src/misc/pty.c 2014-03-19 07:42:48.000000000 +0100
  7655. @@ -26,7 +26,7 @@
  7656. {
  7657. int pty, err;
  7658. if (!buf) len = 0;
  7659. - if ((err = __syscall(SYS_ioctl, fd, TIOCGPTN, &pty))) return err;
  7660. + if ((err = __syscall(SYS_ioctl, fd, TIOCGPTN, &pty))) return -err;
  7661. if (snprintf(buf, len, "/dev/pts/%d", pty) >= len) return ERANGE;
  7662. return 0;
  7663. }
  7664. diff -Nur musl-0.9.15/src/misc/syscall.c musl-git/src/misc/syscall.c
  7665. --- musl-0.9.15/src/misc/syscall.c 2014-01-03 21:12:18.000000000 +0100
  7666. +++ musl-git/src/misc/syscall.c 2014-03-19 07:42:48.000000000 +0100
  7667. @@ -6,14 +6,14 @@
  7668. long syscall(long n, ...)
  7669. {
  7670. va_list ap;
  7671. - long a,b,c,d,e,f;
  7672. + syscall_arg_t a,b,c,d,e,f;
  7673. va_start(ap, n);
  7674. - a=va_arg(ap, long);
  7675. - b=va_arg(ap, long);
  7676. - c=va_arg(ap, long);
  7677. - d=va_arg(ap, long);
  7678. - e=va_arg(ap, long);
  7679. - f=va_arg(ap, long);
  7680. + a=va_arg(ap, syscall_arg_t);
  7681. + b=va_arg(ap, syscall_arg_t);
  7682. + c=va_arg(ap, syscall_arg_t);
  7683. + d=va_arg(ap, syscall_arg_t);
  7684. + e=va_arg(ap, syscall_arg_t);
  7685. + f=va_arg(ap, syscall_arg_t);
  7686. va_end(ap);
  7687. return __syscall_ret(__syscall(n,a,b,c,d,e,f));
  7688. }
  7689. diff -Nur musl-0.9.15/src/network/accept4.c musl-git/src/network/accept4.c
  7690. --- musl-0.9.15/src/network/accept4.c 2014-01-03 21:12:18.000000000 +0100
  7691. +++ musl-git/src/network/accept4.c 2014-03-19 07:42:48.000000000 +0100
  7692. @@ -1,9 +1,20 @@
  7693. #define _GNU_SOURCE
  7694. #include <sys/socket.h>
  7695. +#include <errno.h>
  7696. +#include <fcntl.h>
  7697. #include "syscall.h"
  7698. #include "libc.h"
  7699. int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
  7700. {
  7701. - return socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
  7702. + if (!flg) return accept(fd, addr, len);
  7703. + int ret = socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
  7704. + if (ret>=0 || (errno != ENOSYS && errno != EINVAL)) return ret;
  7705. + ret = accept(fd, addr, len);
  7706. + if (ret<0) return ret;
  7707. + if (flg & SOCK_CLOEXEC)
  7708. + __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
  7709. + if (flg & SOCK_NONBLOCK)
  7710. + __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
  7711. + return ret;
  7712. }
  7713. diff -Nur musl-0.9.15/src/network/inet_legacy.c musl-git/src/network/inet_legacy.c
  7714. --- musl-0.9.15/src/network/inet_legacy.c 2014-01-03 21:12:18.000000000 +0100
  7715. +++ musl-git/src/network/inet_legacy.c 2014-03-19 07:42:48.000000000 +0100
  7716. @@ -16,9 +16,8 @@
  7717. return 1;
  7718. }
  7719. -struct in_addr inet_makeaddr(int net, int host)
  7720. +struct in_addr inet_makeaddr(in_addr_t n, in_addr_t h)
  7721. {
  7722. - uint32_t n = net, h = host;
  7723. if (n < 256) h |= n<<24;
  7724. else if (n < 65536) h |= n<<16;
  7725. else h |= n<<8;
  7726. diff -Nur musl-0.9.15/src/network/proto.c musl-git/src/network/proto.c
  7727. --- musl-0.9.15/src/network/proto.c 2014-01-03 21:12:18.000000000 +0100
  7728. +++ musl-git/src/network/proto.c 2014-03-19 07:42:48.000000000 +0100
  7729. @@ -4,7 +4,7 @@
  7730. /* do we really need all these?? */
  7731. static int idx;
  7732. -static const unsigned char protos[][6] = {
  7733. +static const unsigned char protos[][8] = {
  7734. "\000ip",
  7735. "\001icmp",
  7736. "\002igmp",
  7737. @@ -13,7 +13,9 @@
  7738. "\014pup",
  7739. "\021udp",
  7740. "\026idp",
  7741. - "\377raw"
  7742. + "\051ipv6",
  7743. + "\072icmpv6",
  7744. + "\377raw",
  7745. "\0\0"
  7746. };
  7747. diff -Nur musl-0.9.15/src/prng/random.c musl-git/src/prng/random.c
  7748. --- musl-0.9.15/src/prng/random.c 2014-01-03 21:12:18.000000000 +0100
  7749. +++ musl-git/src/prng/random.c 2014-03-19 07:42:48.000000000 +0100
  7750. @@ -1,10 +1,3 @@
  7751. -/*
  7752. - * random.c - Copyright © 2011 Szabolcs Nagy
  7753. - * Permission to use, copy, modify, and/or distribute this code
  7754. - * for any purpose with or without fee is hereby granted.
  7755. - * There is no warranty.
  7756. -*/
  7757. -
  7758. #include <stdlib.h>
  7759. #include <stdint.h>
  7760. #include "libc.h"
  7761. @@ -12,11 +5,7 @@
  7762. /*
  7763. this code uses the same lagged fibonacci generator as the
  7764. original bsd random implementation except for the seeding
  7765. -
  7766. -different seeds produce different sequences with long period
  7767. -(other libcs seed the state with a park-miller generator
  7768. -when seed=0 some fail to produce good random sequence
  7769. -others produce the same sequence as another seed)
  7770. +which was broken in the original
  7771. */
  7772. static uint32_t init[] = {
  7773. @@ -98,6 +87,7 @@
  7774. n = 63;
  7775. x = (uint32_t*)state + 1;
  7776. __srandom(seed);
  7777. + savestate();
  7778. UNLOCK(lock);
  7779. return old;
  7780. }
  7781. diff -Nur musl-0.9.15/src/process/posix_spawn.c musl-git/src/process/posix_spawn.c
  7782. --- musl-0.9.15/src/process/posix_spawn.c 2014-01-03 21:12:18.000000000 +0100
  7783. +++ musl-git/src/process/posix_spawn.c 2014-03-19 07:42:48.000000000 +0100
  7784. @@ -166,7 +166,7 @@
  7785. close(args.p[0]);
  7786. - if (!ec) *res = pid;
  7787. + if (!ec && res) *res = pid;
  7788. pthread_sigmask(SIG_SETMASK, &args.oldmask, 0);
  7789. pthread_setcancelstate(cs, 0);
  7790. diff -Nur musl-0.9.15/src/process/x32/vfork.s musl-git/src/process/x32/vfork.s
  7791. --- musl-0.9.15/src/process/x32/vfork.s 1970-01-01 01:00:00.000000000 +0100
  7792. +++ musl-git/src/process/x32/vfork.s 2014-03-19 07:42:48.000000000 +0100
  7793. @@ -0,0 +1,12 @@
  7794. +.global __vfork
  7795. +.weak vfork
  7796. +.type __vfork,@function
  7797. +.type vfork,@function
  7798. +__vfork:
  7799. +vfork:
  7800. + pop %rdx
  7801. + mov $0x4000003a,%eax /* SYS_vfork */
  7802. + syscall
  7803. + push %rdx
  7804. + mov %rax,%rdi
  7805. + jmp __syscall_ret
  7806. diff -Nur musl-0.9.15/src/setjmp/mipsel-sf/longjmp.sub musl-git/src/setjmp/mipsel-sf/longjmp.sub
  7807. --- musl-0.9.15/src/setjmp/mipsel-sf/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7808. +++ musl-git/src/setjmp/mipsel-sf/longjmp.sub 2014-03-19 07:42:48.000000000 +0100
  7809. @@ -0,0 +1 @@
  7810. +../mips-sf/longjmp.s
  7811. diff -Nur musl-0.9.15/src/setjmp/mipsel-sf/setjmp.sub musl-git/src/setjmp/mipsel-sf/setjmp.sub
  7812. --- musl-0.9.15/src/setjmp/mipsel-sf/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7813. +++ musl-git/src/setjmp/mipsel-sf/setjmp.sub 2014-03-19 07:42:48.000000000 +0100
  7814. @@ -0,0 +1 @@
  7815. +../mips-sf/setjmp.s
  7816. diff -Nur musl-0.9.15/src/setjmp/mips-sf/longjmp.s musl-git/src/setjmp/mips-sf/longjmp.s
  7817. --- musl-0.9.15/src/setjmp/mips-sf/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7818. +++ musl-git/src/setjmp/mips-sf/longjmp.s 2014-03-19 07:42:48.000000000 +0100
  7819. @@ -0,0 +1,25 @@
  7820. +.set noreorder
  7821. +
  7822. +.global _longjmp
  7823. +.global longjmp
  7824. +.type _longjmp,@function
  7825. +.type longjmp,@function
  7826. +_longjmp:
  7827. +longjmp:
  7828. + move $2, $5
  7829. + bne $2, $0, 1f
  7830. + nop
  7831. + addu $2, $2, 1
  7832. +1: lw $ra, 0($4)
  7833. + lw $sp, 4($4)
  7834. + lw $16, 8($4)
  7835. + lw $17, 12($4)
  7836. + lw $18, 16($4)
  7837. + lw $19, 20($4)
  7838. + lw $20, 24($4)
  7839. + lw $21, 28($4)
  7840. + lw $22, 32($4)
  7841. + lw $23, 36($4)
  7842. + lw $30, 40($4)
  7843. + jr $ra
  7844. + lw $28, 44($4)
  7845. diff -Nur musl-0.9.15/src/setjmp/mips-sf/longjmp.sub musl-git/src/setjmp/mips-sf/longjmp.sub
  7846. --- musl-0.9.15/src/setjmp/mips-sf/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7847. +++ musl-git/src/setjmp/mips-sf/longjmp.sub 2014-03-19 07:42:48.000000000 +0100
  7848. @@ -0,0 +1 @@
  7849. +longjmp.s
  7850. diff -Nur musl-0.9.15/src/setjmp/mips-sf/setjmp.s musl-git/src/setjmp/mips-sf/setjmp.s
  7851. --- musl-0.9.15/src/setjmp/mips-sf/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7852. +++ musl-git/src/setjmp/mips-sf/setjmp.s 2014-03-19 07:42:48.000000000 +0100
  7853. @@ -0,0 +1,25 @@
  7854. +.set noreorder
  7855. +
  7856. +.global __setjmp
  7857. +.global _setjmp
  7858. +.global setjmp
  7859. +.type __setjmp,@function
  7860. +.type _setjmp,@function
  7861. +.type setjmp,@function
  7862. +__setjmp:
  7863. +_setjmp:
  7864. +setjmp:
  7865. + sw $ra, 0($4)
  7866. + sw $sp, 4($4)
  7867. + sw $16, 8($4)
  7868. + sw $17, 12($4)
  7869. + sw $18, 16($4)
  7870. + sw $19, 20($4)
  7871. + sw $20, 24($4)
  7872. + sw $21, 28($4)
  7873. + sw $22, 32($4)
  7874. + sw $23, 36($4)
  7875. + sw $30, 40($4)
  7876. + sw $28, 44($4)
  7877. + jr $ra
  7878. + li $2, 0
  7879. diff -Nur musl-0.9.15/src/setjmp/mips-sf/setjmp.sub musl-git/src/setjmp/mips-sf/setjmp.sub
  7880. --- musl-0.9.15/src/setjmp/mips-sf/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7881. +++ musl-git/src/setjmp/mips-sf/setjmp.sub 2014-03-19 07:42:48.000000000 +0100
  7882. @@ -0,0 +1 @@
  7883. +setjmp.s
  7884. diff -Nur musl-0.9.15/src/setjmp/sh/longjmp.s musl-git/src/setjmp/sh/longjmp.s
  7885. --- musl-0.9.15/src/setjmp/sh/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7886. +++ musl-git/src/setjmp/sh/longjmp.s 2014-03-19 07:42:48.000000000 +0100
  7887. @@ -0,0 +1,26 @@
  7888. +.global _longjmp
  7889. +.global longjmp
  7890. +.type _longjmp, @function
  7891. +.type longjmp, @function
  7892. +_longjmp:
  7893. +longjmp:
  7894. + mov.l @r4+, r8
  7895. + mov.l @r4+, r9
  7896. + mov.l @r4+, r10
  7897. + mov.l @r4+, r11
  7898. + mov.l @r4+, r12
  7899. + mov.l @r4+, r13
  7900. + mov.l @r4+, r14
  7901. + mov.l @r4+, r15
  7902. + lds.l @r4+, pr
  7903. + fmov.s @r4+, fr12
  7904. + fmov.s @r4+, fr13
  7905. + fmov.s @r4+, fr14
  7906. + fmov.s @r4+, fr15
  7907. +
  7908. + tst r5, r5
  7909. + movt r0
  7910. + add r5, r0
  7911. +
  7912. + rts
  7913. + nop
  7914. diff -Nur musl-0.9.15/src/setjmp/sh/setjmp.s musl-git/src/setjmp/sh/setjmp.s
  7915. --- musl-0.9.15/src/setjmp/sh/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7916. +++ musl-git/src/setjmp/sh/setjmp.s 2014-03-19 07:42:48.000000000 +0100
  7917. @@ -0,0 +1,25 @@
  7918. +.global __setjmp
  7919. +.global _setjmp
  7920. +.global setjmp
  7921. +.type __setjmp, @function
  7922. +.type _setjmp, @function
  7923. +.type setjmp, @function
  7924. +__setjmp:
  7925. +_setjmp:
  7926. +setjmp:
  7927. + add #52, r4
  7928. + fmov.s fr15, @-r4
  7929. + fmov.s fr14, @-r4
  7930. + fmov.s fr13, @-r4
  7931. + fmov.s fr12, @-r4
  7932. + sts.l pr, @-r4
  7933. + mov.l r15 @-r4
  7934. + mov.l r14, @-r4
  7935. + mov.l r13, @-r4
  7936. + mov.l r12, @-r4
  7937. + mov.l r11, @-r4
  7938. + mov.l r10, @-r4
  7939. + mov.l r9, @-r4
  7940. + mov.l r8, @-r4
  7941. + rts
  7942. + mov #0, r0
  7943. diff -Nur musl-0.9.15/src/setjmp/sheb-nofpu/longjmp.sub musl-git/src/setjmp/sheb-nofpu/longjmp.sub
  7944. --- musl-0.9.15/src/setjmp/sheb-nofpu/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7945. +++ musl-git/src/setjmp/sheb-nofpu/longjmp.sub 2014-03-19 07:42:48.000000000 +0100
  7946. @@ -0,0 +1 @@
  7947. +../sh-nofpu/longjmp.s
  7948. diff -Nur musl-0.9.15/src/setjmp/sheb-nofpu/setjmp.sub musl-git/src/setjmp/sheb-nofpu/setjmp.sub
  7949. --- musl-0.9.15/src/setjmp/sheb-nofpu/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7950. +++ musl-git/src/setjmp/sheb-nofpu/setjmp.sub 2014-03-19 07:42:48.000000000 +0100
  7951. @@ -0,0 +1 @@
  7952. +../sh-nofpu/setjmp.s
  7953. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/longjmp.s musl-git/src/setjmp/sh-nofpu/longjmp.s
  7954. --- musl-0.9.15/src/setjmp/sh-nofpu/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7955. +++ musl-git/src/setjmp/sh-nofpu/longjmp.s 2014-03-19 07:42:48.000000000 +0100
  7956. @@ -0,0 +1,22 @@
  7957. +.global _longjmp
  7958. +.global longjmp
  7959. +.type _longjmp, @function
  7960. +.type longjmp, @function
  7961. +_longjmp:
  7962. +longjmp:
  7963. + mov.l @r4+, r8
  7964. + mov.l @r4+, r9
  7965. + mov.l @r4+, r10
  7966. + mov.l @r4+, r11
  7967. + mov.l @r4+, r12
  7968. + mov.l @r4+, r13
  7969. + mov.l @r4+, r14
  7970. + mov.l @r4+, r15
  7971. + lds.l @r4+, pr
  7972. +
  7973. + tst r5, r5
  7974. + movt r0
  7975. + add r5, r0
  7976. +
  7977. + rts
  7978. + nop
  7979. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/longjmp.sub musl-git/src/setjmp/sh-nofpu/longjmp.sub
  7980. --- musl-0.9.15/src/setjmp/sh-nofpu/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7981. +++ musl-git/src/setjmp/sh-nofpu/longjmp.sub 2014-03-19 07:42:48.000000000 +0100
  7982. @@ -0,0 +1 @@
  7983. +longjmp.s
  7984. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/setjmp.s musl-git/src/setjmp/sh-nofpu/setjmp.s
  7985. --- musl-0.9.15/src/setjmp/sh-nofpu/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7986. +++ musl-git/src/setjmp/sh-nofpu/setjmp.s 2014-03-19 07:42:48.000000000 +0100
  7987. @@ -0,0 +1,21 @@
  7988. +.global __setjmp
  7989. +.global _setjmp
  7990. +.global setjmp
  7991. +.type __setjmp, @function
  7992. +.type _setjmp, @function
  7993. +.type setjmp, @function
  7994. +__setjmp:
  7995. +_setjmp:
  7996. +setjmp:
  7997. + add #36, r4
  7998. + sts.l pr, @-r4
  7999. + mov.l r15 @-r4
  8000. + mov.l r14, @-r4
  8001. + mov.l r13, @-r4
  8002. + mov.l r12, @-r4
  8003. + mov.l r11, @-r4
  8004. + mov.l r10, @-r4
  8005. + mov.l r9, @-r4
  8006. + mov.l r8, @-r4
  8007. + rts
  8008. + mov #0, r0
  8009. diff -Nur musl-0.9.15/src/setjmp/sh-nofpu/setjmp.sub musl-git/src/setjmp/sh-nofpu/setjmp.sub
  8010. --- musl-0.9.15/src/setjmp/sh-nofpu/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  8011. +++ musl-git/src/setjmp/sh-nofpu/setjmp.sub 2014-03-19 07:42:48.000000000 +0100
  8012. @@ -0,0 +1 @@
  8013. +setjmp.s
  8014. diff -Nur musl-0.9.15/src/setjmp/x32/longjmp.s musl-git/src/setjmp/x32/longjmp.s
  8015. --- musl-0.9.15/src/setjmp/x32/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  8016. +++ musl-git/src/setjmp/x32/longjmp.s 2014-03-19 07:42:48.000000000 +0100
  8017. @@ -0,0 +1,22 @@
  8018. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  8019. +.global _longjmp
  8020. +.global longjmp
  8021. +.type _longjmp,@function
  8022. +.type longjmp,@function
  8023. +_longjmp:
  8024. +longjmp:
  8025. + mov %rsi,%rax /* val will be longjmp return */
  8026. + test %rax,%rax
  8027. + jnz 1f
  8028. + inc %rax /* if val==0, val=1 per longjmp semantics */
  8029. +1:
  8030. + mov (%rdi),%rbx /* rdi is the jmp_buf, restore regs from it */
  8031. + mov 8(%rdi),%rbp
  8032. + mov 16(%rdi),%r12
  8033. + mov 24(%rdi),%r13
  8034. + mov 32(%rdi),%r14
  8035. + mov 40(%rdi),%r15
  8036. + mov 48(%rdi),%rdx /* this ends up being the stack pointer */
  8037. + mov %rdx,%rsp
  8038. + mov 56(%rdi),%rdx /* this is the instruction pointer */
  8039. + jmp *%rdx /* goto saved address without altering rsp */
  8040. diff -Nur musl-0.9.15/src/setjmp/x32/setjmp.s musl-git/src/setjmp/x32/setjmp.s
  8041. --- musl-0.9.15/src/setjmp/x32/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  8042. +++ musl-git/src/setjmp/x32/setjmp.s 2014-03-19 07:42:48.000000000 +0100
  8043. @@ -0,0 +1,22 @@
  8044. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  8045. +.global __setjmp
  8046. +.global _setjmp
  8047. +.global setjmp
  8048. +.type __setjmp,@function
  8049. +.type _setjmp,@function
  8050. +.type setjmp,@function
  8051. +__setjmp:
  8052. +_setjmp:
  8053. +setjmp:
  8054. + mov %rbx,(%rdi) /* rdi is jmp_buf, move registers onto it */
  8055. + mov %rbp,8(%rdi)
  8056. + mov %r12,16(%rdi)
  8057. + mov %r13,24(%rdi)
  8058. + mov %r14,32(%rdi)
  8059. + mov %r15,40(%rdi)
  8060. + lea 8(%rsp),%rdx /* this is our rsp WITHOUT current ret addr */
  8061. + mov %rdx,48(%rdi)
  8062. + mov (%rsp),%rdx /* save return addr ptr for new rip */
  8063. + mov %rdx,56(%rdi)
  8064. + xor %rax,%rax /* always return 0 */
  8065. + ret
  8066. diff -Nur musl-0.9.15/src/signal/mips/sigsetjmp.s musl-git/src/signal/mips/sigsetjmp.s
  8067. --- musl-0.9.15/src/signal/mips/sigsetjmp.s 2014-01-03 21:12:18.000000000 +0100
  8068. +++ musl-git/src/signal/mips/sigsetjmp.s 2014-03-19 07:42:48.000000000 +0100
  8069. @@ -11,7 +11,7 @@
  8070. sw $4, 20($sp)
  8071. sw $ra, 24($sp)
  8072. sw $gp, 28($sp)
  8073. - addu $6, $4, 124
  8074. + addu $6, $4, 108
  8075. li $5, 0
  8076. li $4, 1
  8077. sw $4, -4($6)
  8078. diff -Nur musl-0.9.15/src/signal/sh/restore.s musl-git/src/signal/sh/restore.s
  8079. --- musl-0.9.15/src/signal/sh/restore.s 1970-01-01 01:00:00.000000000 +0100
  8080. +++ musl-git/src/signal/sh/restore.s 2014-03-19 07:42:48.000000000 +0100
  8081. @@ -0,0 +1,24 @@
  8082. +.global __restore
  8083. +.type __restore, @function
  8084. +__restore:
  8085. + mov #119, r3 !__NR_sigreturn
  8086. + trapa #16
  8087. +
  8088. + or r0, r0
  8089. + or r0, r0
  8090. + or r0, r0
  8091. + or r0, r0
  8092. + or r0, r0
  8093. +
  8094. +.global __restore_rt
  8095. +.type __restore_rt, @function
  8096. +__restore_rt:
  8097. + mov #100, r3 !__NR_rt_sigreturn
  8098. + add #73, r3
  8099. + trapa #16
  8100. +
  8101. + or r0, r0
  8102. + or r0, r0
  8103. + or r0, r0
  8104. + or r0, r0
  8105. + or r0, r0
  8106. diff -Nur musl-0.9.15/src/signal/sh/sigsetjmp.s musl-git/src/signal/sh/sigsetjmp.s
  8107. --- musl-0.9.15/src/signal/sh/sigsetjmp.s 1970-01-01 01:00:00.000000000 +0100
  8108. +++ musl-git/src/signal/sh/sigsetjmp.s 2014-03-19 07:42:48.000000000 +0100
  8109. @@ -0,0 +1,27 @@
  8110. +.global sigsetjmp
  8111. +.type sigsetjmp, @function
  8112. +sigsetjmp:
  8113. + mov.l r5, @(36,r4)
  8114. + tst r5, r5
  8115. + bf 2f
  8116. +
  8117. + sts.l pr, @-r15
  8118. + mov.l r4, @-r15
  8119. + mov r4, r6
  8120. + add #40, r6
  8121. + mov #0, r5
  8122. + mov #2, r4
  8123. + mov.l L1, r0
  8124. + bsrf r0
  8125. + nop
  8126. +1: mov.l @r15+, r4
  8127. + lds.l @r15+, pr
  8128. +
  8129. +2: mov.l L2, r0
  8130. + braf r0
  8131. + nop
  8132. +3:
  8133. +
  8134. +.align 2
  8135. +L1: .long pthread_sigmask@PLT-(1b-.)
  8136. +L2: .long setjmp@PLT-(3b-.)
  8137. diff -Nur musl-0.9.15/src/signal/sigandset.c musl-git/src/signal/sigandset.c
  8138. --- musl-0.9.15/src/signal/sigandset.c 2014-01-03 21:12:18.000000000 +0100
  8139. +++ musl-git/src/signal/sigandset.c 2014-03-19 07:42:48.000000000 +0100
  8140. @@ -3,7 +3,7 @@
  8141. #define SST_SIZE (_NSIG/8/sizeof(long))
  8142. -int sigandset(sigset_t *dest, sigset_t *left, sigset_t *right)
  8143. +int sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
  8144. {
  8145. unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
  8146. for(; i < SST_SIZE; i++) d[i] = l[i] & r[i];
  8147. diff -Nur musl-0.9.15/src/signal/sigorset.c musl-git/src/signal/sigorset.c
  8148. --- musl-0.9.15/src/signal/sigorset.c 2014-01-03 21:12:18.000000000 +0100
  8149. +++ musl-git/src/signal/sigorset.c 2014-03-19 07:42:48.000000000 +0100
  8150. @@ -3,7 +3,7 @@
  8151. #define SST_SIZE (_NSIG/8/sizeof(long))
  8152. -int sigorset(sigset_t *dest, sigset_t *left, sigset_t *right)
  8153. +int sigorset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
  8154. {
  8155. unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
  8156. for(; i < SST_SIZE; i++) d[i] = l[i] | r[i];
  8157. diff -Nur musl-0.9.15/src/signal/x32/restore.s musl-git/src/signal/x32/restore.s
  8158. --- musl-0.9.15/src/signal/x32/restore.s 1970-01-01 01:00:00.000000000 +0100
  8159. +++ musl-git/src/signal/x32/restore.s 2014-03-19 07:42:48.000000000 +0100
  8160. @@ -0,0 +1,8 @@
  8161. +.global __restore_rt
  8162. +.global __restore
  8163. +.type __restore_rt,@function
  8164. +.type __restore,@function
  8165. +__restore_rt:
  8166. +__restore:
  8167. + movl $0x40000201, %eax /* SYS_rt_sigreturn */
  8168. + syscall
  8169. diff -Nur musl-0.9.15/src/signal/x32/sigsetjmp.s musl-git/src/signal/x32/sigsetjmp.s
  8170. --- musl-0.9.15/src/signal/x32/sigsetjmp.s 1970-01-01 01:00:00.000000000 +0100
  8171. +++ musl-git/src/signal/x32/sigsetjmp.s 2014-03-19 07:42:48.000000000 +0100
  8172. @@ -0,0 +1,14 @@
  8173. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  8174. +.global sigsetjmp
  8175. +.type sigsetjmp,@function
  8176. +sigsetjmp:
  8177. + andl %esi,%esi
  8178. + movq %rsi,64(%rdi)
  8179. + jz 1f
  8180. + pushq %rdi
  8181. + leaq 72(%rdi),%rdx
  8182. + xorl %esi,%esi
  8183. + movl $2,%edi
  8184. + call sigprocmask
  8185. + popq %rdi
  8186. +1: jmp setjmp
  8187. diff -Nur musl-0.9.15/src/stdio/__fdopen.c musl-git/src/stdio/__fdopen.c
  8188. --- musl-0.9.15/src/stdio/__fdopen.c 2014-01-03 21:12:18.000000000 +0100
  8189. +++ musl-git/src/stdio/__fdopen.c 2014-03-19 07:42:48.000000000 +0100
  8190. @@ -32,7 +32,9 @@
  8191. /* Set append mode on fd if opened for append */
  8192. if (*mode == 'a') {
  8193. int flags = __syscall(SYS_fcntl, fd, F_GETFL);
  8194. - __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND);
  8195. + if (!(flags & O_APPEND))
  8196. + __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND);
  8197. + f->flags |= F_APP;
  8198. }
  8199. f->fd = fd;
  8200. diff -Nur musl-0.9.15/src/stdio/ftell.c musl-git/src/stdio/ftell.c
  8201. --- musl-0.9.15/src/stdio/ftell.c 2014-01-03 21:12:18.000000000 +0100
  8202. +++ musl-git/src/stdio/ftell.c 2014-03-19 07:42:48.000000000 +0100
  8203. @@ -4,7 +4,9 @@
  8204. off_t __ftello_unlocked(FILE *f)
  8205. {
  8206. - off_t pos = f->seek(f, 0, SEEK_CUR);
  8207. + off_t pos = f->seek(f, 0,
  8208. + (f->flags & F_APP) && f->wpos > f->wbase
  8209. + ? SEEK_END : SEEK_CUR);
  8210. if (pos < 0) return pos;
  8211. /* Adjust for data in buffer. */
  8212. diff -Nur musl-0.9.15/src/stdio/vfprintf.c musl-git/src/stdio/vfprintf.c
  8213. --- musl-0.9.15/src/stdio/vfprintf.c 2014-01-03 21:12:18.000000000 +0100
  8214. +++ musl-git/src/stdio/vfprintf.c 2014-03-19 07:42:48.000000000 +0100
  8215. @@ -207,7 +207,8 @@
  8216. static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t)
  8217. {
  8218. - uint32_t big[(LDBL_MAX_EXP+LDBL_MANT_DIG)/9+1];
  8219. + uint32_t big[(LDBL_MANT_DIG+28)/29 + 1 // mantissa expansion
  8220. + + (LDBL_MAX_EXP+LDBL_MANT_DIG+28+8)/9]; // exponent expansion
  8221. uint32_t *a, *d, *r, *z;
  8222. int e2=0, e, i, j, l;
  8223. char buf[9+LDBL_MANT_DIG/4], *s;
  8224. @@ -313,7 +314,7 @@
  8225. }
  8226. while (e2<0) {
  8227. uint32_t carry=0, *b;
  8228. - int sh=MIN(9,-e2);
  8229. + int sh=MIN(9,-e2), need=1+(p+LDBL_MANT_DIG/3+8)/9;
  8230. for (d=a; d<z; d++) {
  8231. uint32_t rm = *d & (1<<sh)-1;
  8232. *d = (*d>>sh) + carry;
  8233. @@ -323,7 +324,7 @@
  8234. if (carry) *z++ = carry;
  8235. /* Avoid (slow!) computation past requested precision */
  8236. b = (t|32)=='f' ? r : a;
  8237. - if (z-b > 2+p/9) z = b+2+p/9;
  8238. + if (z-b > need) z = b+need;
  8239. e2+=sh;
  8240. }
  8241. diff -Nur musl-0.9.15/src/stdio/vfscanf.c musl-git/src/stdio/vfscanf.c
  8242. --- musl-0.9.15/src/stdio/vfscanf.c 2014-01-03 21:12:18.000000000 +0100
  8243. +++ musl-git/src/stdio/vfscanf.c 2014-03-19 07:42:48.000000000 +0100
  8244. @@ -328,3 +328,5 @@
  8245. FUNLOCK(f);
  8246. return matches;
  8247. }
  8248. +
  8249. +weak_alias(vfscanf,__isoc99_vfscanf);
  8250. diff -Nur musl-0.9.15/src/thread/arm/clone.s musl-git/src/thread/arm/clone.s
  8251. --- musl-0.9.15/src/thread/arm/clone.s 2014-01-03 21:12:18.000000000 +0100
  8252. +++ musl-git/src/thread/arm/clone.s 2014-03-19 07:42:48.000000000 +0100
  8253. @@ -1,10 +1,7 @@
  8254. .text
  8255. .global __clone
  8256. -.weak clone
  8257. .type __clone,%function
  8258. -.type clone,%function
  8259. __clone:
  8260. -clone:
  8261. stmfd sp!,{r4,r5,r6,r7}
  8262. mov r7,#120
  8263. mov r6,r3
  8264. diff -Nur musl-0.9.15/src/thread/cancel_dummy.c musl-git/src/thread/cancel_dummy.c
  8265. --- musl-0.9.15/src/thread/cancel_dummy.c 2014-01-03 21:12:18.000000000 +0100
  8266. +++ musl-git/src/thread/cancel_dummy.c 2014-03-19 07:42:48.000000000 +0100
  8267. @@ -1,6 +1,9 @@
  8268. #include "pthread_impl.h"
  8269. +#include "syscall.h"
  8270. -static long sccp(long nr, long u, long v, long w, long x, long y, long z)
  8271. +static long sccp(syscall_arg_t nr,
  8272. + syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
  8273. + syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
  8274. {
  8275. return (__syscall)(nr, u, v, w, x, y, z);
  8276. }
  8277. diff -Nur musl-0.9.15/src/thread/cancel_impl.c musl-git/src/thread/cancel_impl.c
  8278. --- musl-0.9.15/src/thread/cancel_impl.c 2014-01-03 21:12:18.000000000 +0100
  8279. +++ musl-git/src/thread/cancel_impl.c 2014-03-19 07:42:48.000000000 +0100
  8280. @@ -1,4 +1,5 @@
  8281. #include "pthread_impl.h"
  8282. +#include "syscall.h"
  8283. void __cancel()
  8284. {
  8285. @@ -8,9 +9,13 @@
  8286. pthread_exit(PTHREAD_CANCELED);
  8287. }
  8288. -long __syscall_cp_asm(volatile void *, long, long, long, long, long, long, long);
  8289. +long __syscall_cp_asm(volatile void *, syscall_arg_t,
  8290. + syscall_arg_t, syscall_arg_t, syscall_arg_t,
  8291. + syscall_arg_t, syscall_arg_t, syscall_arg_t);
  8292. -long (__syscall_cp)(long nr, long u, long v, long w, long x, long y, long z)
  8293. +long (__syscall_cp)(syscall_arg_t nr,
  8294. + syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
  8295. + syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
  8296. {
  8297. pthread_t self;
  8298. long r;
  8299. diff -Nur musl-0.9.15/src/thread/clone.c musl-git/src/thread/clone.c
  8300. --- musl-0.9.15/src/thread/clone.c 2014-01-03 21:12:18.000000000 +0100
  8301. +++ musl-git/src/thread/clone.c 2014-03-19 07:42:48.000000000 +0100
  8302. @@ -1,10 +1,7 @@
  8303. #include <errno.h>
  8304. -#include "libc.h"
  8305. +#include "pthread_impl.h"
  8306. int __clone(int (*func)(void *), void *stack, int flags, void *arg, ...)
  8307. {
  8308. - errno = ENOSYS;
  8309. - return -1;
  8310. + return -ENOSYS;
  8311. }
  8312. -
  8313. -weak_alias(__clone, clone);
  8314. diff -Nur musl-0.9.15/src/thread/i386/clone.s musl-git/src/thread/i386/clone.s
  8315. --- musl-0.9.15/src/thread/i386/clone.s 2014-01-03 21:12:18.000000000 +0100
  8316. +++ musl-git/src/thread/i386/clone.s 2014-03-19 07:42:48.000000000 +0100
  8317. @@ -1,10 +1,7 @@
  8318. .text
  8319. .global __clone
  8320. -.weak clone
  8321. .type __clone,@function
  8322. -.type clone,@function
  8323. __clone:
  8324. -clone:
  8325. push %ebp
  8326. mov %esp,%ebp
  8327. push %ebx
  8328. diff -Nur musl-0.9.15/src/thread/microblaze/clone.s musl-git/src/thread/microblaze/clone.s
  8329. --- musl-0.9.15/src/thread/microblaze/clone.s 2014-01-03 21:12:18.000000000 +0100
  8330. +++ musl-git/src/thread/microblaze/clone.s 2014-03-19 07:42:48.000000000 +0100
  8331. @@ -1,14 +1,11 @@
  8332. .global __clone
  8333. -.weak clone
  8334. .type __clone,@function
  8335. -.type clone,@function
  8336. # r5, r6, r7, r8, r9, r10, stack
  8337. # fn, st, fl, ar, pt, tl, ct
  8338. # fl, st, __, pt, ct, tl
  8339. __clone:
  8340. -clone:
  8341. andi r6, r6, -16
  8342. addi r6, r6, -16
  8343. swi r5, r6, 0
  8344. @@ -23,7 +20,7 @@
  8345. beqi r3, 1f
  8346. rtsd r15, 8
  8347. nop
  8348. -
  8349. +
  8350. 1: lwi r3, r1, 0
  8351. lwi r5, r1, 4
  8352. brald r15, r3
  8353. diff -Nur musl-0.9.15/src/thread/sh/clone.s musl-git/src/thread/sh/clone.s
  8354. --- musl-0.9.15/src/thread/sh/clone.s 1970-01-01 01:00:00.000000000 +0100
  8355. +++ musl-git/src/thread/sh/clone.s 2014-03-19 07:42:48.000000000 +0100
  8356. @@ -0,0 +1,47 @@
  8357. +.text
  8358. +.global __clone
  8359. +.type __clone, @function
  8360. +__clone:
  8361. +! incoming: fn stack flags arg ptid tls ctid
  8362. +! r4 r5 r6 r7 @r15 @(4,r15) @(8,r15)
  8363. +
  8364. + mov #-16, r0
  8365. + and r0, r5
  8366. +
  8367. + mov r4, r1 ! r1 = fn
  8368. + mov r7, r2 ! r2 = arg
  8369. +
  8370. + mov #120, r3 ! r3 = __NR_clone
  8371. + mov r6, r4 ! r4 = flags
  8372. + !mov r5, r5 ! r5 = stack
  8373. + mov.l @r15, r6 ! r6 = ptid
  8374. + mov.l @(8,r15), r7 ! r7 = ctid
  8375. + mov.l @(4,r15), r0 ! r0 = tls
  8376. + trapa #21
  8377. +
  8378. + or r0, r0
  8379. + or r0, r0
  8380. + or r0, r0
  8381. + or r0, r0
  8382. + or r0, r0
  8383. +
  8384. + cmp/eq #0, r0
  8385. + bt 1f
  8386. +
  8387. + ! we are the parent, return
  8388. + rts
  8389. + nop
  8390. +
  8391. +1: ! we are the child, call fn(arg)
  8392. + jsr @r1
  8393. + mov r2, r4
  8394. +
  8395. + mov #1, r3 ! __NR_exit
  8396. + mov r0, r4
  8397. + trapa #17
  8398. +
  8399. + or r0, r0
  8400. + or r0, r0
  8401. + or r0, r0
  8402. + or r0, r0
  8403. + or r0, r0
  8404. diff -Nur musl-0.9.15/src/thread/sh/__set_thread_area.s musl-git/src/thread/sh/__set_thread_area.s
  8405. --- musl-0.9.15/src/thread/sh/__set_thread_area.s 1970-01-01 01:00:00.000000000 +0100
  8406. +++ musl-git/src/thread/sh/__set_thread_area.s 2014-03-19 07:42:48.000000000 +0100
  8407. @@ -0,0 +1,5 @@
  8408. +.global __set_thread_area
  8409. +.type __set_thread_area, @function
  8410. +__set_thread_area:
  8411. + rts
  8412. + ldc r4, gbr
  8413. diff -Nur musl-0.9.15/src/thread/sh/syscall_cp.s musl-git/src/thread/sh/syscall_cp.s
  8414. --- musl-0.9.15/src/thread/sh/syscall_cp.s 1970-01-01 01:00:00.000000000 +0100
  8415. +++ musl-git/src/thread/sh/syscall_cp.s 2014-03-19 07:42:48.000000000 +0100
  8416. @@ -0,0 +1,39 @@
  8417. +.text
  8418. +.global __syscall_cp_asm
  8419. +.type __syscall_cp_asm, @function
  8420. +__syscall_cp_asm:
  8421. +
  8422. +.global __cp_begin
  8423. +__cp_begin:
  8424. + mov.l @r4, r4
  8425. + tst r4, r4
  8426. + bt 2f
  8427. +
  8428. + mov.l L1, r0
  8429. + braf r0
  8430. + nop
  8431. +1:
  8432. +
  8433. +.align 2
  8434. +L1: .long __cancel@PLT-(1b-.)
  8435. +
  8436. +2: mov r5, r3
  8437. + mov r6, r4
  8438. + mov r7, r5
  8439. + mov.l @r15, r6
  8440. + mov.l @(4,r15), r7
  8441. + mov.l @(8,r15), r0
  8442. + mov.l @(12,r15), r1
  8443. + trapa #22
  8444. +
  8445. +.global __cp_end
  8446. +__cp_end:
  8447. + ! work around hardware bug
  8448. + or r0, r0
  8449. + or r0, r0
  8450. + or r0, r0
  8451. + or r0, r0
  8452. + or r0, r0
  8453. +
  8454. + rts
  8455. + nop
  8456. diff -Nur musl-0.9.15/src/thread/sh/__unmapself.s musl-git/src/thread/sh/__unmapself.s
  8457. --- musl-0.9.15/src/thread/sh/__unmapself.s 1970-01-01 01:00:00.000000000 +0100
  8458. +++ musl-git/src/thread/sh/__unmapself.s 2014-03-19 07:42:48.000000000 +0100
  8459. @@ -0,0 +1,22 @@
  8460. +.text
  8461. +.global __unmapself
  8462. +.type __unmapself, @function
  8463. +__unmapself:
  8464. + mov #91, r3 ! SYS_munmap
  8465. + trapa #18
  8466. +
  8467. + or r0, r0
  8468. + or r0, r0
  8469. + or r0, r0
  8470. + or r0, r0
  8471. + or r0, r0
  8472. +
  8473. + mov #1, r3 ! SYS_exit
  8474. + mov #0, r4
  8475. + trapa #17
  8476. +
  8477. + or r0, r0
  8478. + or r0, r0
  8479. + or r0, r0
  8480. + or r0, r0
  8481. + or r0, r0
  8482. diff -Nur musl-0.9.15/src/thread/__wait.c musl-git/src/thread/__wait.c
  8483. --- musl-0.9.15/src/thread/__wait.c 2014-01-03 21:12:18.000000000 +0100
  8484. +++ musl-git/src/thread/__wait.c 2014-03-19 07:42:48.000000000 +0100
  8485. @@ -10,6 +10,6 @@
  8486. }
  8487. if (waiters) a_inc(waiters);
  8488. while (*addr==val)
  8489. - __syscall(SYS_futex, (long)addr, FUTEX_WAIT|priv, val, 0);
  8490. + __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val, 0);
  8491. if (waiters) a_dec(waiters);
  8492. }
  8493. diff -Nur musl-0.9.15/src/thread/x32/clone.s musl-git/src/thread/x32/clone.s
  8494. --- musl-0.9.15/src/thread/x32/clone.s 1970-01-01 01:00:00.000000000 +0100
  8495. +++ musl-git/src/thread/x32/clone.s 2014-03-19 07:42:48.000000000 +0100
  8496. @@ -0,0 +1,25 @@
  8497. +.text
  8498. +.global __clone
  8499. +.type __clone,@function
  8500. +__clone:
  8501. + movl $0x40000038,%eax /* SYS_clone */
  8502. + mov %rdi,%r11
  8503. + mov %rdx,%rdi
  8504. + mov %r8,%rdx
  8505. + mov %r9,%r8
  8506. + mov 8(%rsp),%r10
  8507. + mov %r11,%r9
  8508. + and $-16,%rsi
  8509. + sub $8,%rsi
  8510. + mov %rcx,(%rsi)
  8511. + syscall
  8512. + test %eax,%eax
  8513. + jnz 1f
  8514. + xor %ebp,%ebp
  8515. + pop %rdi
  8516. + call *%r9
  8517. + mov %eax,%edi
  8518. + movl $0x4000003c,%eax /* SYS_exit */
  8519. + syscall
  8520. + hlt
  8521. +1: ret
  8522. diff -Nur musl-0.9.15/src/thread/x32/__set_thread_area.s musl-git/src/thread/x32/__set_thread_area.s
  8523. --- musl-0.9.15/src/thread/x32/__set_thread_area.s 1970-01-01 01:00:00.000000000 +0100
  8524. +++ musl-git/src/thread/x32/__set_thread_area.s 2014-03-19 07:42:48.000000000 +0100
  8525. @@ -0,0 +1,10 @@
  8526. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  8527. +.text
  8528. +.global __set_thread_area
  8529. +.type __set_thread_area,@function
  8530. +__set_thread_area:
  8531. + mov %rdi,%rsi /* shift for syscall */
  8532. + movl $0x1002,%edi /* SET_FS register */
  8533. + movl $0x4000009e,%eax /* set fs segment to */
  8534. + syscall /* arch_prctl(SET_FS, arg)*/
  8535. + ret
  8536. diff -Nur musl-0.9.15/src/thread/x32/syscall_cp.s musl-git/src/thread/x32/syscall_cp.s
  8537. --- musl-0.9.15/src/thread/x32/syscall_cp.s 1970-01-01 01:00:00.000000000 +0100
  8538. +++ musl-git/src/thread/x32/syscall_cp.s 2014-03-19 07:42:48.000000000 +0100
  8539. @@ -0,0 +1,23 @@
  8540. +.text
  8541. +.global __syscall_cp_internal
  8542. +.type __syscall_cp_internal,@function
  8543. +__syscall_cp_internal:
  8544. +
  8545. +.global __cp_begin
  8546. +__cp_begin:
  8547. + mov (%rdi),%eax
  8548. + test %eax,%eax
  8549. + jnz __cancel
  8550. + mov %rdi,%r11
  8551. + mov %rsi,%rax
  8552. + mov %rdx,%rdi
  8553. + mov %rcx,%rsi
  8554. + mov %r8,%rdx
  8555. + mov %r9,%r10
  8556. + mov 8(%rsp),%r8
  8557. + mov 16(%rsp),%r9
  8558. + mov %r11,8(%rsp)
  8559. + syscall
  8560. +.global __cp_end
  8561. +__cp_end:
  8562. + ret
  8563. diff -Nur musl-0.9.15/src/thread/x32/__unmapself.s musl-git/src/thread/x32/__unmapself.s
  8564. --- musl-0.9.15/src/thread/x32/__unmapself.s 1970-01-01 01:00:00.000000000 +0100
  8565. +++ musl-git/src/thread/x32/__unmapself.s 2014-03-19 07:42:48.000000000 +0100
  8566. @@ -0,0 +1,10 @@
  8567. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  8568. +.text
  8569. +.global __unmapself
  8570. +.type __unmapself,@function
  8571. +__unmapself:
  8572. + movl $0x4000000b,%eax /* SYS_munmap */
  8573. + syscall /* munmap(arg2,arg3) */
  8574. + xor %rdi,%rdi /* exit() args: always return success */
  8575. + movl $0x4000003c,%eax /* SYS_exit */
  8576. + syscall /* exit(0) */
  8577. diff -Nur musl-0.9.15/src/thread/x86_64/clone.s musl-git/src/thread/x86_64/clone.s
  8578. --- musl-0.9.15/src/thread/x86_64/clone.s 2014-01-03 21:12:18.000000000 +0100
  8579. +++ musl-git/src/thread/x86_64/clone.s 2014-03-19 07:42:48.000000000 +0100
  8580. @@ -1,10 +1,7 @@
  8581. .text
  8582. .global __clone
  8583. -.weak clone
  8584. .type __clone,@function
  8585. -.type clone,@function
  8586. __clone:
  8587. -clone:
  8588. xor %eax,%eax
  8589. mov $56,%al
  8590. mov %rdi,%r11
  8591. diff -Nur musl-0.9.15/src/time/timer_delete.c musl-git/src/time/timer_delete.c
  8592. --- musl-0.9.15/src/time/timer_delete.c 2014-01-03 21:12:18.000000000 +0100
  8593. +++ musl-git/src/time/timer_delete.c 2014-03-19 07:42:48.000000000 +0100
  8594. @@ -10,5 +10,5 @@
  8595. __wake(&td->timer_id, 1, 1);
  8596. return 0;
  8597. }
  8598. - return __syscall(SYS_timer_delete, (long)t);
  8599. + return __syscall(SYS_timer_delete, t);
  8600. }
  8601. diff -Nur musl-0.9.15/src/time/timer_getoverrun.c musl-git/src/time/timer_getoverrun.c
  8602. --- musl-0.9.15/src/time/timer_getoverrun.c 2014-01-03 21:12:18.000000000 +0100
  8603. +++ musl-git/src/time/timer_getoverrun.c 2014-03-19 07:42:48.000000000 +0100
  8604. @@ -8,5 +8,5 @@
  8605. pthread_t td = (void *)((uintptr_t)t << 1);
  8606. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  8607. }
  8608. - return syscall(SYS_timer_getoverrun, (long)t);
  8609. + return syscall(SYS_timer_getoverrun, t);
  8610. }
  8611. diff -Nur musl-0.9.15/src/time/timer_gettime.c musl-git/src/time/timer_gettime.c
  8612. --- musl-0.9.15/src/time/timer_gettime.c 2014-01-03 21:12:18.000000000 +0100
  8613. +++ musl-git/src/time/timer_gettime.c 2014-03-19 07:42:48.000000000 +0100
  8614. @@ -8,5 +8,5 @@
  8615. pthread_t td = (void *)((uintptr_t)t << 1);
  8616. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  8617. }
  8618. - return syscall(SYS_timer_gettime, (long)t, val);
  8619. + return syscall(SYS_timer_gettime, t, val);
  8620. }
  8621. diff -Nur musl-0.9.15/src/time/timer_settime.c musl-git/src/time/timer_settime.c
  8622. --- musl-0.9.15/src/time/timer_settime.c 2014-01-03 21:12:18.000000000 +0100
  8623. +++ musl-git/src/time/timer_settime.c 2014-03-19 07:42:48.000000000 +0100
  8624. @@ -8,5 +8,5 @@
  8625. pthread_t td = (void *)((uintptr_t)t << 1);
  8626. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  8627. }
  8628. - return syscall(SYS_timer_settime, (long)t, flags, val, old);
  8629. + return syscall(SYS_timer_settime, t, flags, val, old);
  8630. }
  8631. diff -Nur musl-0.9.15/src/unistd/sh/pipe.s musl-git/src/unistd/sh/pipe.s
  8632. --- musl-0.9.15/src/unistd/sh/pipe.s 1970-01-01 01:00:00.000000000 +0100
  8633. +++ musl-git/src/unistd/sh/pipe.s 2014-03-19 07:42:48.000000000 +0100
  8634. @@ -0,0 +1,27 @@
  8635. +.global pipe
  8636. +.type pipe, @function
  8637. +pipe:
  8638. + mov #42, r3
  8639. + trapa #17
  8640. +
  8641. + ! work around hardware bug
  8642. + or r0, r0
  8643. + or r0, r0
  8644. + or r0, r0
  8645. + or r0, r0
  8646. + or r0, r0
  8647. +
  8648. + cmp/pz r0
  8649. + bt 1f
  8650. +
  8651. + mov.l L1, r1
  8652. + braf r1
  8653. + mov r0, r4
  8654. +
  8655. +1: mov.l r0, @(0,r4)
  8656. + mov.l r1, @(4,r4)
  8657. + rts
  8658. + mov #0, r0
  8659. +
  8660. +.align 2
  8661. +L1: .long __syscall_ret@PLT-(1b-.)
  8662. diff -Nur musl-0.9.15/tools/install.sh musl-git/tools/install.sh
  8663. --- musl-0.9.15/tools/install.sh 2014-01-03 21:12:18.000000000 +0100
  8664. +++ musl-git/tools/install.sh 2014-03-19 07:42:48.000000000 +0100
  8665. @@ -51,6 +51,7 @@
  8666. ln -s "$1" "$tmp"
  8667. else
  8668. cat < "$1" > "$tmp"
  8669. +chmod "$mode" "$tmp"
  8670. fi
  8671. mv -f "$tmp" "$2"
  8672. @@ -60,6 +61,4 @@
  8673. exit 1
  8674. }
  8675. -test "$symlink" || chmod "$mode" "$2"
  8676. -
  8677. exit 0