Welcome to the Tiny Core Linux Wiki at tinycorelinux.net!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:creating_extensions [2018/07/08 18:49]
aus9 [Submitting]
wiki:creating_extensions [2018/07/12 06:25] (current)
JustinCB
Line 62: Line 62:
 export LDFLAGS="-Wl,-O1" export LDFLAGS="-Wl,-O1"
 </code> </code>
-It is OK to use lower architectures in -march and -mtune than the recommended(-march=i386 is OK, and -mtune=i586 and -mtune=i486 and -mtune=i386), however it is not OK to use higher architectures in -march and not recommended to use higher architectures in -mtune (eg. -march=i586).  +It is OK to use lower architectures in -march and -mtune than the recommended(-march=i386 is OK, and -mtune=i586 and -mtune=i486 and -mtune=i386), however it is not OK to use higher architectures in -march and not recommended to use higher architectures in -mtune (eg. -march=i586).  It isn't necessary to use "-pipe" and if you get an error about -Wl you can omit it.  You might be able to specify a different -O value to LDFLAGS and you might be able to use "-Oz" in the place of "-Os" but that may only work for "clang" &amp; not "gcc"
  
 Suggested compiler flags on x86_64 (for compatibility; see also [[http://forum.tinycorelinux.net/index.php/topic,14397.0.html|the forum thread]]): Suggested compiler flags on x86_64 (for compatibility; see also [[http://forum.tinycorelinux.net/index.php/topic,14397.0.html|the forum thread]]):
Line 70: Line 70:
 export LDFLAGS="-Wl,-O1" export LDFLAGS="-Wl,-O1"
 </code> </code>
 +Again, "-pipe" isn't necessary &amp; if you get an error about "-Wl" you can leave it out
  
 Suggested compiler flags on RPi (discussed in [[http://forum.tinycorelinux.net/index.php/topic,17059.0.html|this forum thread]]): Suggested compiler flags on RPi (discussed in [[http://forum.tinycorelinux.net/index.php/topic,17059.0.html|this forum thread]]):
Line 77: Line 78:
 export LDFLAGS="-Wl,-O1" export LDFLAGS="-Wl,-O1"
 </code> </code>
 +Again, "-pipe" isn't necessary &amp; if you get an error about "-Wl" you can leave it out
  
 If you wish to try to get a lower sized C++ app, you can try adding "-fno-exceptions -fno-rtti" to CXXFLAGS. Use only on C++ applications, libraries should use the same flags as in CFLAGS above. If you wish to try to get a lower sized C++ app, you can try adding "-fno-exceptions -fno-rtti" to CXXFLAGS. Use only on C++ applications, libraries should use the same flags as in CFLAGS above.
Line 82: Line 84:
 For apps that do not use threads (pthread_cancel), the following flag reduces binary size: "-fno-asynchronous-unwind-tables". For apps that do not use threads (pthread_cancel), the following flag reduces binary size: "-fno-asynchronous-unwind-tables".
  
-For apps that need speed (math library or so), you can use "-O2" flag instead of "-Os" flag.+For apps that need speed (math library or so), you can use "-O2" flag instead of "-Os" flag.  The "-Oz" flag is not portable but you can use it if you're compiling with "clang"(CC="clang" and CXX="clang").  It gives smaller binaries than "-Os".
  
 Flags Not-allowed (good performance, but likely won't work on other machines): Flags Not-allowed (good performance, but likely won't work on other machines):
Line 332: Line 334:
 </code>   </code>  
  
-If the package contains a program, the best choice for its name is the bin name (this will ensure that program start directly if you load package ondemand[but you need to make an executable shell script usr/local/tcz.installed/<bin_name> for that to work{make the script then do   chmod +x usr/local/tcz.installed/<bin_name>}])+If the package contains a program, the best choice for its name is the bin name (this will ensure that program start directly if you load package ondemand[but you need to make an executable shell script usr/local/tce.installed/<bin_name> for that to work{make the script then do   chmod +x usr/local/tce.installed/<bin_name>}]).  The paths would be under you package's root.  
  
 In field "Comments" string "PPI Compatible" (if the package is compatible with "Persistent Personal Installation" mode, usually if we have used /usr/local directory as a installation prefix) seems no longer to be specified since this type of operation has been removed from 4.x and later.  Of course, it doesn't break anything to add PPI Compatible, but it can be kind of confusing since it was removed 4 major releases ago!   In field "Comments" string "PPI Compatible" (if the package is compatible with "Persistent Personal Installation" mode, usually if we have used /usr/local directory as a installation prefix) seems no longer to be specified since this type of operation has been removed from 4.x and later.  Of course, it doesn't break anything to add PPI Compatible, but it can be kind of confusing since it was removed 4 major releases ago!  
Line 367: Line 369:
 =====  Submitting =====   =====  Submitting =====  
  
-Have you run the extension audit script(submitqcx[where x is the major release of tinycore that you have] or submitqc) to test your extension? If so, create a gzip archive. For example, if all the required files are in one directory, the command would look like this:  +Have you run the extension audit script(submitqcx[where x is the major release of tinycore that you have{legacy, not available for newer releases}] or submitqc) to test your extension? If so, create a gzip archive. For example, if all the required files are in one directory, the command would look like this:  
  
 <code bash> <code bash>
Print/export