Hi Agnelo, I think that mixing C++ code in OpenOCD will make the build process overly complicated. The code checker 'checkpatch' that we use, should not work on C++ code. Switching to C++ will give us the headache to decide how to replace it. Instead of mixing C and C++, I would prefer sticking to C code only and linking to external libraries written in any language.
Moreover, I have read quickly few files in EUD code, and they require some major rework to match OpenOCD coding style, e.g.: - name of variables and functions, including CamelCase issue - indentation of 4 whitespace - ab-use of typedef and I expect the script checkpatch will find other points. While I would love to see the EUD reworked to be merged into OpenOCD, I believe it would require too much work on your side. Feasible but heavy. The solution of having EUD as an external library, adding in OpenOCD a wrap code, looks to me the faster and easier option. Said that, it's up to you to choose. Regards Antonio On Mon, Jan 26, 2026 at 6:22 PM Agnelo Dcosta <[email protected]> wrote: > > Hi @Antonio Borneo, > > We had some more discussions internally and we think it is better to have the > EUD code directly available in the OpenOCD repository. > An issue though, is that the EUD code is predominantly C++ code with C > wrappers. > Is it ok to add C++ code into the OpenOCD repo? > > Thanks > Agnelo > ________________________________ > From: Antonio Borneo <[email protected]> > Sent: Saturday, October 18, 2025 12:27 PM > To: Agnelo Dcosta <[email protected]> > Cc: Tommy Murphy <[email protected]>; Ashi Gupta > <[email protected]>; openocd-devel <[email protected]> > Subject: Re: ERROR:EMBEDDED_FILENAME: for changes in configure.ac > > WARNING: This email originated from outside of Qualcomm. Please be wary of > any links or attachments, and do not enable macros. > > On Sat, Oct 18, 2025 at 7:38 AM Agnelo Dcosta <[email protected]> > wrote: > > > > Thanks for your response, Antonio and Tommy > > > > > Can the driver be upstream in the OpenOCD code directly? > > > What's the license of the driver's code? > > > > Yes, The EUD Source code is available at https://github.com/quic/eud under > > licenses GPL-2.0 OR BSD-3 > > > > We did deliberate internally some time ago, regarding upstreaming the Code > > into OpenOCD directly. > > The EUD library, however, is used by multiple other tools and utilities > > which is why we decided that EUD code should exist as a separate > > independent entity. > > If submodule support is being deprecated, we are ok to switch to link time > > external library mode - in fact that is how we had originally done it. > > Just to be certain, we should have a configure option like > > "--enable-external-eud" isn't it? > > Cool! > There are helpers in configure.ac so you don't need to explicitly add > the option. > > The library should be packaged within "pkg-config" to be easily used > in the configuration script. > > Probably the closest match is by looking at LINUXGPIOD.It's a driver > that has an external dependency from the library 'libgpiod'. > There is some extra code due to incompatibility between version 1 and > 2 of the library that you should ignore, that's easy to spot. > Just search case-insensitive for the string 'gpiod' in configure.ac > and you get the 6 places to update (I suppose you don't need to enable > bitbanging). > > Regards > Antonio
