diff --git a/abc-format.patch b/abc-format.patch index 8ba0e49..5e8dc15 100644 --- a/abc-format.patch +++ b/abc-format.patch @@ -1,5 +1,5 @@ ---- src/aig/miniaig/ndr.h.orig 2019-12-17 15:57:46.000000000 -0700 -+++ src/aig/miniaig/ndr.h 2019-12-18 09:47:14.076891270 -0700 +--- src/aig/miniaig/ndr.h.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/aig/miniaig/ndr.h 2021-03-31 09:29:26.418031142 -0600 @@ -496,8 +496,16 @@ static inline void Ndr_WriteVerilog( cha { Ndr_Data_t * p = (Ndr_Data_t *)pDesign; int Mod; @@ -19,8 +19,51 @@ Ndr_DesForEachMod( p, Mod ) Ndr_WriteVerilogModule( pFile, p, Mod, pNames ); ---- src/base/abci/abcMiter.c.orig 2019-12-17 15:57:46.000000000 -0700 -+++ src/base/abci/abcMiter.c 2019-12-18 09:44:30.567338848 -0700 +--- src/aig/saig/saigIoa.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/aig/saig/saigIoa.c 2021-03-31 09:36:36.926608970 -0600 +@@ -47,15 +47,15 @@ char * Saig_ObjName( Aig_Man_t * p, Aig_ + { + static char Buffer[16]; + if ( Aig_ObjIsNode(pObj) || Aig_ObjIsConst1(pObj) ) +- sprintf( Buffer, "n%0*d", Abc_Base10Log(Aig_ManObjNumMax(p)), Aig_ObjId(pObj) ); ++ snprintf( Buffer, 16, "n%0*d", Abc_Base10Log(Aig_ManObjNumMax(p)), Aig_ObjId(pObj) ); + else if ( Saig_ObjIsPi(p, pObj) ) +- sprintf( Buffer, "pi%0*d", Abc_Base10Log(Saig_ManPiNum(p)), Aig_ObjCioId(pObj) ); ++ snprintf( Buffer, 16, "pi%0*d", Abc_Base10Log(Saig_ManPiNum(p)), Aig_ObjCioId(pObj) ); + else if ( Saig_ObjIsPo(p, pObj) ) +- sprintf( Buffer, "po%0*d", Abc_Base10Log(Saig_ManPoNum(p)), Aig_ObjCioId(pObj) ); ++ snprintf( Buffer, 16, "po%0*d", Abc_Base10Log(Saig_ManPoNum(p)), Aig_ObjCioId(pObj) ); + else if ( Saig_ObjIsLo(p, pObj) ) +- sprintf( Buffer, "lo%0*d", Abc_Base10Log(Saig_ManRegNum(p)), Aig_ObjCioId(pObj) - Saig_ManPiNum(p) ); ++ snprintf( Buffer, 16, "lo%0*d", Abc_Base10Log(Saig_ManRegNum(p)), Aig_ObjCioId(pObj) - Saig_ManPiNum(p) ); + else if ( Saig_ObjIsLi(p, pObj) ) +- sprintf( Buffer, "li%0*d", Abc_Base10Log(Saig_ManRegNum(p)), Aig_ObjCioId(pObj) - Saig_ManPoNum(p) ); ++ snprintf( Buffer, 16, "li%0*d", Abc_Base10Log(Saig_ManRegNum(p)), Aig_ObjCioId(pObj) - Saig_ManPoNum(p) ); + else + assert( 0 ); + return Buffer; +--- src/base/abci/abc.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/base/abci/abc.c 2021-03-31 09:33:02.855819044 -0600 +@@ -30623,7 +30623,7 @@ int Abc_CommandAbc9Put( Abc_Frame_t * pA + else + { + assert( i >= Abc_NtkPoNum(pNtk) ); +- sprintf( pSuffix, "_li%0*d", nDigits, i-Abc_NtkPoNum(pNtk) ); ++ snprintf( pSuffix, 100, "_li%0*d", nDigits, i-Abc_NtkPoNum(pNtk) ); + Abc_ObjAssignName( pObj, (char *)Vec_PtrEntry(pAbc->pGia->vNamesOut, i), pSuffix ); + } + } +@@ -42868,7 +42868,7 @@ int Abc_CommandAbc9Cone( Abc_Frame_t * p + Gia_ManForEachPo( pAbc->pGia, pObj, i ) + { + Gia_Man_t * pOne = Gia_ManDupDfsCone( pAbc->pGia, pObj ); +- sprintf( Buffer, "%s_%0*d.aig", Extra_FileNameGeneric(pAbc->pGia->pSpec), nDigits, i ); ++ snprintf( Buffer, 1000, "%s_%0*d.aig", Extra_FileNameGeneric(pAbc->pGia->pSpec), nDigits, i ); + Gia_AigerWrite( pOne, Buffer, 0, 0, 0 ); + Gia_ManStop( pOne ); + } +--- src/base/abci/abcMiter.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/base/abci/abcMiter.c 2021-03-31 09:29:26.419031141 -0600 @@ -863,7 +863,7 @@ void Abc_NtkAddFrame( Abc_Ntk_t * pNtkFr { int fVerbose = 0; @@ -30,8 +73,8 @@ Abc_Obj_t * pNode, * pLatch; int i; // create the prefix to be added to the node names ---- src/base/io/ioReadBlifMv.c.orig 2019-12-18 09:43:13.388550105 -0700 -+++ src/base/io/ioReadBlifMv.c 2019-12-18 09:43:30.483503314 -0700 +--- src/base/io/ioReadBlifMv.c.orig 2021-03-31 09:51:35.257716654 -0600 ++++ src/base/io/ioReadBlifMv.c 2021-03-31 09:51:55.691695924 -0600 @@ -1626,7 +1626,7 @@ static int Io_MvParseLineMv( Io_MvMod_t ***********************************************************************/ static int Io_MvWriteValues( Abc_Obj_t * pNode, Vec_Str_t * vFunc ) @@ -50,8 +93,28 @@ Io_MvVar_t * pVar; Abc_Obj_t * pFanin, * pNet; char * pCur, * pNext; ---- src/base/wlc/wlcNdr.c.orig 2019-12-17 15:57:46.000000000 -0700 -+++ src/base/wlc/wlcNdr.c 2019-12-18 08:43:25.865457806 -0700 +--- src/base/io/ioReadPla.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/base/io/ioReadPla.c 2021-03-31 09:32:18.454862614 -0600 +@@ -448,7 +448,7 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_Fil + nDigits = Abc_Base10Log( nInputs ); + for ( i = 0; i < nInputs; i++ ) + { +- sprintf( Buffer, "x%0*d", nDigits, i ); ++ snprintf( Buffer, 100, "x%0*d", nDigits, i ); + Io_ReadCreatePi( pNtk, Buffer ); + } + } +@@ -465,7 +465,7 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_Fil + nDigits = Abc_Base10Log( nOutputs ); + for ( i = 0; i < nOutputs; i++ ) + { +- sprintf( Buffer, "z%0*d", nDigits, i ); ++ snprintf( Buffer, 100, "z%0*d", nDigits, i ); + Io_ReadCreatePo( pNtk, Buffer ); + } + } +--- src/base/wlc/wlcNdr.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/base/wlc/wlcNdr.c 2021-03-31 09:29:26.420031140 -0600 @@ -487,7 +487,7 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData pNtk->pManName = Abc_NamStart( NameIdMax+1, 10 ); for ( i = 1; i <= NameIdMax; i++ ) @@ -61,8 +124,53 @@ NameId = Abc_NamStrFindOrAdd( pNtk->pManName, pName, &fFound ); assert( !fFound && i == NameId ); } ---- src/base/wln/wlnNdr.c.orig 2019-12-17 15:57:46.000000000 -0700 -+++ src/base/wln/wlnNdr.c 2019-12-18 08:43:25.866457804 -0700 +--- src/base/wlc/wlcNtk.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/base/wlc/wlcNtk.c 2021-03-31 09:34:20.110743240 -0600 +@@ -1300,7 +1300,7 @@ void Wlc_NtkShortNames( Wlc_Ntk_t * p ) + { + if ( Wlc_ObjIsPo(pObj) ) + continue; +- sprintf( pBuffer, "%s%0*d", "fi", nDigits, i - Wlc_NtkPoNum(p) ); ++ snprintf( pBuffer, 100, "%s%0*d", "fi", nDigits, i - Wlc_NtkPoNum(p) ); + NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound ); + Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId ); + } +@@ -1308,21 +1308,21 @@ void Wlc_NtkShortNames( Wlc_Ntk_t * p ) + { + if ( Wlc_ObjIsPi(pObj) ) + continue; +- sprintf( pBuffer, "%s%0*d", "fo", nDigits, i - Wlc_NtkPiNum(p) ); ++ snprintf( pBuffer, 100, "%s%0*d", "fo", nDigits, i - Wlc_NtkPiNum(p) ); + NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound ); + Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId ); + } + nDigits = Abc_Base10Log( Wlc_NtkPoNum(p) ); + Wlc_NtkForEachPo( p, pObj, i ) + { +- sprintf( pBuffer, "%s%0*d", "po", nDigits, i ); ++ snprintf( pBuffer, 100, "%s%0*d", "po", nDigits, i ); + NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound ); + Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId ); + } + nDigits = Abc_Base10Log( Wlc_NtkPiNum(p) ); + Wlc_NtkForEachPi( p, pObj, i ) + { +- sprintf( pBuffer, "%s%0*d", "pi", nDigits, i ); ++ snprintf( pBuffer, 100, "%s%0*d", "pi", nDigits, i ); + NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound ); + Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId ); + } +@@ -1331,7 +1331,7 @@ void Wlc_NtkShortNames( Wlc_Ntk_t * p ) + { + if ( Wlc_ObjIsCi(pObj) || Wlc_ObjIsCo(pObj) ) + continue; +- sprintf( pBuffer, "%s%0*d", "n", nDigits, i ); ++ snprintf( pBuffer, 100, "%s%0*d", "n", nDigits, i ); + NameId = Abc_NamStrFindOrAdd( p->pManName, pBuffer, &fFound ); + Wlc_ObjSetNameId( p, Wlc_ObjId(p, pObj), NameId ); + } +--- src/base/wln/wlnNdr.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/base/wln/wlnNdr.c 2021-03-31 09:29:26.420031140 -0600 @@ -256,7 +256,7 @@ Wln_Ntk_t * Wln_NtkFromNdr( void * pData pNtk->pManName = Abc_NamStart( NameIdMax+1, 10 ); for ( i = 1; i <= NameIdMax; i++ ) @@ -72,8 +180,30 @@ NameId = Abc_NamStrFindOrAdd( pNtk->pManName, pName, &fFound ); assert( !fFound && i == NameId ); } ---- src/opt/dau/dauMerge.c.orig 2019-12-17 15:57:46.000000000 -0700 -+++ src/opt/dau/dauMerge.c 2019-12-18 09:48:48.630632559 -0700 +--- src/map/mio/mioUtils.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/map/mio/mioUtils.c 2021-03-31 09:34:48.486715391 -0600 +@@ -1711,7 +1711,7 @@ void Mio_LibraryShortNames( Mio_Library_ + Mio_LibraryForEachGate( pLib, pGate ) + { + ABC_FREE( pGate->pName ); +- sprintf( Buffer, "g%0*d", nDigits, ++c ); ++ snprintf( Buffer, 10000, "g%0*d", nDigits, ++c ); + pGate->pName = Abc_UtilStrsav( Buffer ); + // update formula + Mio_LibraryShortFormula( pGate, pGate->pForm, Buffer ); +--- src/map/scl/sclLibUtil.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/map/scl/sclLibUtil.c 2021-03-31 09:35:12.574691754 -0600 +@@ -203,7 +203,7 @@ void Abc_SclShortNames( SC_Lib * p ) + SC_RingForEachCell( pClass, pCell, k ) + { + ABC_FREE( pCell->pName ); +- sprintf( Buffer, "g%0*d_%0*d", nDigits, i, nDigits2, k ); ++ snprintf( Buffer, 10000, "g%0*d_%0*d", nDigits, i, nDigits2, k ); + pCell->pName = Abc_UtilStrsav( Buffer ); + // formula + SC_CellForEachPinOut( pCell, pPin, n ) +--- src/opt/dau/dauMerge.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/opt/dau/dauMerge.c 2021-03-31 09:29:26.421031139 -0600 @@ -715,7 +715,7 @@ Dau_DsdMergeStorePrintDefs( pS ); // create new function @@ -83,8 +213,8 @@ pTruth = Dau_DsdToTruth( pS->pOutput, nVarsTotal ); Status = Dau_DsdDecompose( pTruth, nVarsTotal, 0, 1, pS->pOutput ); //printf( "%d ", Status ); ---- src/proof/fra/fraCore.c.orig 2019-12-17 15:57:46.000000000 -0700 -+++ src/proof/fra/fraCore.c 2019-12-18 09:50:22.838375767 -0700 +--- src/proof/fra/fraCore.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/proof/fra/fraCore.c 2021-03-31 09:29:26.421031139 -0600 @@ -163,7 +163,7 @@ static inline void Fra_FraigNodeSpeculat // create manager with the logic for these two nodes pTemp = Aig_ManExtractMiter( p->pManFraig, pObjFraig, pObjReprFraig ); diff --git a/abc-overflow.patch b/abc-overflow.patch new file mode 100644 index 0000000..96a1d6f --- /dev/null +++ b/abc-overflow.patch @@ -0,0 +1,11 @@ +--- src/map/if/ifDsd.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/map/if/ifDsd.c 2021-03-31 09:50:14.911798180 -0600 +@@ -91,7 +91,7 @@ struct If_DsdMan_t_ + Vec_Mem_t * vTtMem[IF_MAX_FUNC_LUTSIZE+1]; // truth table memory and hash table + Vec_Ptr_t * vTtDecs[IF_MAX_FUNC_LUTSIZE+1]; // truth table decompositions + Vec_Wec_t * vIsops[IF_MAX_FUNC_LUTSIZE+1]; // ISOP for each function +- int * pSched[IF_MAX_FUNC_LUTSIZE]; // grey code schedules ++ int * pSched[IF_MAX_FUNC_LUTSIZE+1]; // grey code schedules + int nTtBits; // the number of truth table bits + int nConfigWords; // the number of words for config data per node + Vec_Wrd_t * vConfigs; // permutations diff --git a/abc-strict-aliasing.patch b/abc-strict-aliasing.patch new file mode 100644 index 0000000..ad2673b --- /dev/null +++ b/abc-strict-aliasing.patch @@ -0,0 +1,17 @@ +--- src/aig/gia/giaUtil.c.orig 2021-03-28 19:40:27.000000000 -0600 ++++ src/aig/gia/giaUtil.c 2021-03-31 09:24:59.453286422 -0600 +@@ -2109,11 +2109,13 @@ void Gia_AigerWriteLut( Gia_Man_t * p, c + Gia_ManForEachObj( p, pObj, i ) + if ( i && Gia_ObjIsLut(p, i) ) + { ++ word truth; + pLuts[iLut].Type = 3; + Gia_LutForEachFanin( p, i, iFan, k ) + pLuts[iLut].pFans[k] = Gia_ManObj(p, iFan)->Value; + pLuts[iLut].nFans = k; +- *(word *)pLuts[iLut].pTruth = Gia_LutComputeTruth6(p, i, vTruths); ++ truth = Gia_LutComputeTruth6(p, i, vTruths); ++ memcpy( pLuts[iLut].pTruth, &truth, sizeof(word) ); + pObj->Value = pLuts[iLut].Out = Abc_Var2Lit( iLut, 0 ); + iLut++; + } diff --git a/abc.spec b/abc.spec index d0d44ec..45cc8c1 100644 --- a/abc.spec +++ b/abc.spec @@ -1,8 +1,8 @@ # Upstream doesn't make releases. We have to check the code out of git. %global owner berkeley-abc -%global gittag d4fb192575cd319de68764eac5b7e049f575f43e +%global gittag 9145a5c20d5fe85523364d7fe2727b8d83c90aaa %global shorttag %(cut -b -7 <<< %{gittag}) -%global gitdate 20201126 +%global gitdate 20210328 # WARNING: When updating to a newer snapshot, because upstream doesn't do # shared library versioning, run abipkgdiff (from libabigail) against the @@ -22,7 +22,7 @@ Name: abc Version: 1.01 -Release: 29.git%{gitdate}%{?dist} +Release: 30.git%{gitdate}%{?dist} Summary: Sequential logic synthesis and formal verification License: MIT @@ -44,6 +44,10 @@ Patch4: %{name}-format.patch # Fix an out-of-bounds array access in the gia code # https://github.com/berkeley-abc/abc/pull/89 Patch5: %{name}-gia.patch +# Fix some code that violates strict aliasing rules +Patch6: %{name}-strict-aliasing.patch +# Prevent a possible buffer overflow +Patch7: %{name}-overflow.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -100,10 +104,13 @@ sed -i 's/ -O//' Makefile %build export CFLAGS="%{optflags} -DNDEBUG" +%ifarch s390x +CFLAGS="$CFLAGS -DEPD_BIG_ENDIAN" +%endif export CXXFLAGS="$CFLAGS" export ABC_MAKE_VERBOSE=1 export ABC_USE_STDINT_H=1 -%cmake +%cmake -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES %cmake_build %install @@ -144,6 +151,11 @@ install -p -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1 %{_libdir}/lib%{name}.so %changelog +* Wed Mar 31 2021 Jerry James - 1.01-30.git20210328 +- Update to latest git snapshot +- Add patches: -strict-aliasing, -overflow +- Avoid bogus rpaths + * Mon Jan 25 2021 Fedora Release Engineering - 1.01-29.git20201126 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index ea7e794..5176329 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (abc-d4fb192.tar.gz) = be33bac2854172c01eee1ffe15cf9395fa8fd981efab3ca7ae64a72af3ab7272f8d8c06c63ae9a706691df6838bcfe859f056069f7c94bf030b9a5deeac1d977 +SHA512 (abc-9145a5c.tar.gz) = 9390afee0dadee8947114e0927a77a43d6d0e8dca2eb2d15390079db39ff32ca6685c20d60e7cb60f5e695f683a3ccb7e6420dc1e6755aa4deb7f2a1272570e5