diff --git a/.gitignore b/.gitignore index 91e7003..eb31d2b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,3 @@ /urjtag-20171020-git-49a4f5b5.tar.bz2 /urjtag-2017.10.tar.xz /urjtag-2018.06.tar.xz -/urjtag-2018.09.tar.xz -/urjtag-2019.12.tar.xz -/urjtag-2021.03.tar.xz diff --git a/0001-svf-guard-against-chain-cable-being-NULL.patch b/0001-svf-guard-against-chain-cable-being-NULL.patch new file mode 100644 index 0000000..dacec66 --- /dev/null +++ b/0001-svf-guard-against-chain-cable-being-NULL.patch @@ -0,0 +1,48 @@ +From 84eeef108d36c7aa725e6b8098960937c5d1b38e Mon Sep 17 00:00:00 2001 +From: Scott Tsai +Date: Fri, 16 Dec 2011 05:56:39 +0800 +Subject: [PATCH] svf: guard against chain->cable being NULL + +While processing: +cable ft2232 vid=0x0403 pid=0x6011 +bsdl path . +detect +svf ./orpsoc_top.svf stop progress +quit + +If the specified cable isn't present, jtag would SEGFAULT with this backtrace: + #0 urj_tap_cable_get_frequency (cable=0x0) at cable.c:529 + #1 0x00007fefd4f4803a in urj_svf_run (chain=0x20562a0, SVF_FILE=0x20567b0, stop_on_mismatch=1, ref_freq=0) at svf.c:1117 + #2 0x00007fefd4f40681 in cmd_svf_run (chain=0x20562a0, params=0x20565a0) at cmd_svf.c:83 + #3 0x00007fefd4f3e9ad in urj_cmd_run (chain=0x20562a0, params=0x20565a0) at cmd_cmd.c:276 + #4 0x00007fefd4f4438d in urj_parse_line (chain=0x20562a0, line=0x2056520 "svf ./orpsoc_top.svf stop progress") at parse.c:165 + #5 0x00007fefd4f44447 in urj_parse_stream (chain=0x20562a0, f=0x20562e0) at parse.c:207 + #6 0x00007fefd4f4456b in urj_parse_file (chain=0x20562a0, filename=0x7fff90576b92 "./program_fpga.jtag") at parse.c:235 + #7 0x00000000004016c1 in main (argc=2, argv=) at jtag.c:486 + +This patch changes urj_svf_run to guard against chain->cable being NULL. +--- + urjtag/src/svf/svf.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/urjtag/src/svf/svf.c b/urjtag/src/svf/svf.c +index 9552a6d..2282c77 100644 +--- a/urjtag/src/svf/svf.c ++++ b/urjtag/src/svf/svf.c +@@ -1114,7 +1114,12 @@ urj_svf_run (urj_chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch, + urj_svf_parser_priv_t priv; + int c = ~EOF; + int num_lines; +- uint32_t old_frequency = urj_tap_cable_get_frequency (chain->cable); ++ uint32_t old_frequency; ++ ++ if (chain == NULL || chain->cable == NULL) ++ return URJ_STATUS_FAIL; ++ ++ old_frequency = urj_tap_cable_get_frequency (chain->cable); + + /* get number of lines in svf file so we can give user some feedback on long + files or slow cables */ +-- +1.7.7.5 + diff --git a/sources b/sources index 9956e30..ec46b98 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (urjtag-2021.03.tar.xz) = baf203e556d1d41437539d3f5c018b35fbb496f71391c2bec2786ffa47bff33d38654b3e7d106e38bcf36d075d86fc02b18eaaf634cdb65e2840ff50ca0da8b2 +SHA512 (urjtag-2018.06.tar.xz) = d999d8d84b64e27f978947d8f2b16026bf41080f0fc64ebd775d0933bc3d1745219deca810ca8e4470ade3507f702c44ad2b3d829f6f0804f30f010a6fadb780 diff --git a/urjtag-fixftdi.patch b/urjtag-fixftdi.patch new file mode 100644 index 0000000..0a1aef8 --- /dev/null +++ b/urjtag-fixftdi.patch @@ -0,0 +1,16 @@ +--- urjtag-20111215-git-e1a4227/urjtag/configure.ac.orig 2016-12-09 11:56:56.978518212 +0100 ++++ urjtag-20111215-git-e1a4227/urjtag/configure.ac 2016-12-09 11:57:07.681363295 +0100 +@@ -241,10 +241,10 @@ + save_CPPFLAGS=$CPPFLAGS + PKG_CHECK_MODULES(LIBFTDI, libftdi, [:;], [dnl + AS_IF([test "x$with_libftdi" != xyes -a "x$with_libftdi" != xcheck], [ +- LIBFTDI_LIBS="-L$with_libftdi -lftdi" +- LIBFTDI_CFLAGS="-I$with_libftdi" ++ LIBFTDI_LIBS="-L$with_libftdi1 -lftdi1" ++ LIBFTDI_CFLAGS="-I$with_libftdi1" + ],[ +- AC_PATH_TOOL(LIBFTDI_CONFIG, libftdi-config, no) ++ AC_PATH_TOOL(LIBFTDI_CONFIG, libftdi1-config, no) + AS_IF([test "$LIBFTDI_CONFIG" != "no"],[ + LIBFTDI_LIBS=`$LIBFTDI_CONFIG --libs` + LIBFTDI_CFLAGS=`$LIBFTDI_CONFIG --cflags` diff --git a/urjtag.spec b/urjtag.spec index c88c7ab..d546c54 100644 --- a/urjtag.spec +++ b/urjtag.spec @@ -5,29 +5,37 @@ %endif Name: urjtag -Version: 2021.03 -Release: 23%{?dist} +Version: 2018.06 +Release: 1%{?dist} Summary: A tool for communicating over JTAG with flash chips and CPUs +Group: Development/Tools -# Automatically converted from old format: GPLv2+ - review is highly recommended. -License: GPL-2.0-or-later +License: GPLv2+ URL: http://urjtag.org -Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz +Source0: %{name}-%{version}.tar.xz Patch0: %{name}-fixarm.patch -%global py3_prefix python3 -BuildRequires: make -BuildRequires: gcc +%if 0%{?rhel} || 0%{?centos} +%global py2_prefix python +%else +%global py2_prefix python2 +%endif + +%if 0%{?with_python3} +%global py3_prefix python3 +%endif + BuildRequires: libftdi-devel -BuildRequires: (python3-setuptools if python3-devel >= 3.12) -BuildRequires: readline-devel BuildRequires: swig +BuildRequires: %{py2_prefix}-devel +%if 0%{?with_python3} %if 0%{?rhel} || 0%{?centos} BuildRequires: %{py3_prefix}4-devel %else BuildRequires: %{py3_prefix}-devel %endif +%endif BuildRequires: bison BuildRequires: flex @@ -37,6 +45,7 @@ over JTAG with flash chips, CPUs, and many more. %package devel Summary: Development files for %{name} +Group: Development/Libraries Requires: %{name} = %{version}-%{release} @@ -44,28 +53,52 @@ Requires: %{name} = %{version}-%{release} The %{name}-devel package contains libraries and header files for developing applications that use %{name}. +%package -n %{py2_prefix}-%{name} +%{?python_provide:%python_provide %{py2_prefix}-%{name}} +# Remove before F30 +Provides: %{name}-python = %{version}-%{release} +Provides: %{name}-python%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} +Summary: Python bindings for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%if 0%{?with_python3} %package -n %{py3_prefix}-%{name} %if 0%{?rhel} || 0%{?centos} Provides: python3-%{name} %else %{?python_provide:%python_provide %{py3_prefix}-%{name}} %endif +# Remove before F30 +Provides: %{name}-python%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} Summary: Python bindings for %{name} +Group: Development/Libraries Requires: %{name} = %{version}-%{release} +%endif +%description -n %{py2_prefix}-%{name} +Python bindings and examples for %{name}. + +%if 0%{?with_python3} %description -n %{py3_prefix}-%{name} Python bindings and examples for %{name}. +%endif %prep %setup -q -%patch -P0 -p2 -b .armfix +%patch0 -p2 -b .armfix %build %configure --enable-jedec-exp --enable-stapl --enable-bsdl --enable-svf --disable-static --enable-shared # V=1: verbose build, disables AM_SILENT_RULES %{__make} %{?_smp_mflags} V=1 pushd bindings/python/ +%py2_build +%if 0%{?with_python3} %py3_build +%endif %install # cd urjtag @@ -74,9 +107,14 @@ rm -f %{buildroot}%{_libdir}/*.la rm -f %{buildroot}%{_libdir}/*.a %find_lang %{name} pushd bindings/python/ +%py2_install +%if 0%{?with_python3} %py3_install +%endif -%ldconfig_scriptlets +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig %files -f %{name}.lang %doc README NEWS ChangeLog COPYING AUTHORS @@ -97,121 +135,21 @@ pushd bindings/python/ %{_libdir}/liburjtag.so %{_libdir}/pkgconfig/urjtag.pc +%files -n %{py2_prefix}-%{name} +%{python2_sitearch}/urjtag* +%doc doc/urjtag-python.txt +%doc bindings/python/t_urjtag_chain.py +%doc bindings/python/t_srst.py + +%if 0%{?with_python3} %files -n %{py3_prefix}-%{name} %{python3_sitearch}/urjtag* %doc doc/urjtag-python.txt %doc bindings/python/t_urjtag_chain.py %doc bindings/python/t_srst.py +%endif %changelog -* Wed Jul 22 2026 Python Maint - 2021.03-23 -- Rebuilt for Python 3.15.0b4 ABI change - -* Fri Jul 17 2026 Fedora Release Engineering - 2021.03-22 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Thu Jun 04 2026 Python Maint - 2021.03-21 -- Rebuilt for Python 3.15 - -* Sat Jan 17 2026 Fedora Release Engineering - 2021.03-20 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Fri Sep 19 2025 Python Maint - 2021.03-19 -- Rebuilt for Python 3.14.0rc3 bytecode - -* Fri Aug 15 2025 Python Maint - 2021.03-18 -- Rebuilt for Python 3.14.0rc2 bytecode - -* Fri Jul 25 2025 Fedora Release Engineering - 2021.03-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Tue Jun 03 2025 Python Maint - 2021.03-16 -- Rebuilt for Python 3.14 - -* Sun Jan 19 2025 Fedora Release Engineering - 2021.03-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Fri Jul 26 2024 Miroslav Suchý - 2021.03-14 -- convert license to SPDX - -* Sat Jul 20 2024 Fedora Release Engineering - 2021.03-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sun Jun 09 2024 Python Maint - 2021.03-12 -- Rebuilt for Python 3.13 - -* Sat Jan 27 2024 Fedora Release Engineering - 2021.03-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sun Jul 30 2023 Filipe Rosset - 2021.03-10 -- Fix FTBFS rhbz#2226495 rhbz#2220616 rhbz#2175186 and rhbz#1785878 - -* Sat Jul 22 2023 Fedora Release Engineering - 2021.03-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Jun 13 2023 Python Maint - 2021.03-8 -- Rebuilt for Python 3.12 - -* Sat Jan 21 2023 Fedora Release Engineering - 2021.03-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 2021.03-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Thu Jun 16 2022 Python Maint - 2021.03-5 -- Rebuilt for Python 3.11 - -* Sat Jan 22 2022 Fedora Release Engineering - 2021.03-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 2021.03-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Fri Jun 04 2021 Python Maint - 2021.03-2 -- Rebuilt for Python 3.10 - -* Sat Apr 10 2021 Jiri Kastner - 2021.03-1 -- update to 2021.03 - -* Wed Jan 27 2021 Fedora Release Engineering - 2019.12-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 2019.12-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue May 26 2020 Miro Hrončok - 2019.12-4 -- Rebuilt for Python 3.9 - -* Thu Feb 13 2020 Dan Horák - 2019.12-3 -- fix FTBFS with gcc10 (#1793499) - -* Fri Jan 31 2020 Fedora Release Engineering - 2019.12-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sat Dec 21 2019 Dan Horák - 2019.12-1 -- update to 2019.12 - -* Mon Aug 19 2019 Miro Hrončok - 2018.09-2 -- Rebuilt for Python 3.8 - -* Wed Jul 31 2019 Dan Horák - 2018.09-1 -- update to 2018.09 - -* Sat Jul 27 2019 Fedora Release Engineering - 2018.06-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sun Feb 03 2019 Fedora Release Engineering - 2018.06-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Mon Nov 12 2018 Miro Hrončok - 2018.06-4 -- Remove python2 subpackage (#1628187) - -* Sat Jul 14 2018 Fedora Release Engineering - 2018.06-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Jun 29 2018 Miro Hrončok - 2018.06-2 -- Rebuilt for Python 3.7 - * Mon Jun 25 2018 Jiri Kastner - 2018.06-1 - update to 2018.06