Creative Commons (the people who wrote CC-BY-SA 4 and earlier versions) specifically recommend against using any Creative Commons license on software, because:
Unlike software-specific licenses, CC licenses do not contain specific terms about the distribution of source code, which is often important to ensuring the free reuse and modifiability of software. Many software licenses also address patent rights, which are important to software but may not be applicable to other copyrightable works. Additionally, our licenses are currently not compatible with the major software licenses, so it would be difficult to integrate CC-licensed work with other free software. Existing software licenses were designed specifically for use with software and offer a similar set of rights to the Creative Commons licenses.
However, perhaps in recognition of the increasing tendency of developers to license code with CC-BY-SA in particular, for 4.0 and later they added a one-way compatibility clause with the GNU GPL version 3. This means that, instead of distributing your modified code under CC-BY-SA 4, you may choose to distribute it under GPL 3. This is very likely a Good Idea, because the GPL is specifically designed for software and ensures that downstream reusers will share their source code and build scripts.
If you decide to relicense under the GPL, you should comply with all of the standard requirements on a GPL redistribution. Roughly speaking, that means:
- Make both source code and binaries available in the same way. The usual way to do this is to either bundle them together or to publish them side-by-side but separately. Section 6 of the GPL lists a few alternatives if neither of those options work for you.
- Include a copy of the GPL in your source distribution, and put a license notice in each file, as the FSF recommends.
- The FSF also recommends getting a copyright waiver from your school or employer, if applicable.
- Your source distribution should also include any build scripts or other such materials that are required to build the binaries which you want to distribute. You need not include system libraries or headers.
- The FSF is of the opinion that the line between separate pieces of software is usually drawn at the process boundary. That is, if you have two or more separate processes, then you may only need to GPL the one which includes the code you started with. However, if you choose to divide your program into a lot of tiny processes that are intimately related and not independently useful, then this analysis may not be applicable and you may have to GPL the whole thing. This is the FSF's opinion, and is not necessarily the actual law.
- You should place prominent notices in the source code, README, or other ancillary files that are included in the source distribution (such as a changelog), indicating that you modified the code, and when you did so. It may also be wise to indicate what you changed or added (although your version control system should already have that information, changelogs are easier to read).
- Finally, you should update the copyright notice to add your name and the year(s) of your modifications.